I pooped out a little destroyable terrain thing for Java if you want to see it:
http://www.openprocessing.org/visuals/?visualID=13226Use your mouse to drag around a hole.
Here it is in Side-Scrolling:
http://www.openprocessing.org/visuals/?visualID=13331Controls are the same, but this one involves a lot of convoluted math.
They both use the same technique as worms and openlierox, which is:
1. Pick a point and draw a circle around it.
2. Use collision logic:
Code:
if (player.distance_to_hole < radius_of_hole and PlayerInsideTerrain) then
Don't_collide();
end
Yeah, it's disappointing, but it's how real magicians work.
I bet the method Data uses for CC isn't all THAT complex.
All you'd need is two images, one for the terrain in the beginning, and one for the terrain that's been subtracted or added, and if you are at a point with either image (but not both), then you collide, but if you're at a point where they overlap, then you don't collide.