The sequel to "Outpost:Haven"3.99 / 5.00 23,001 Views
Hunt The Candy!!!3.85 / 5.00 10,167 Views
A thrilling rush through cyberspace!3.78 / 5.00 28,453 Views
First of all, both of these programming scenarios are WAY beyond my knowledge in any computer language. I'm just asking this as a matter of curiosity.
Suppose I have a game with destructible ground. You can throw, say, grenades, and they can destroy a 2D platforming environment. Would it be possible, when explosives damage terrain, to momentarily render the outline of the bitmapData as vector data, and then divide separate shapes into separate objects? I'm asking because most games with destructible terrain will have floating parts in mid-air at one point or another, due to one part of the terrain being erased while another part remains intact but not connected to anything, and obviously it would be most realistic to have those bits of debris fall back down to ground, and maybe fuse back into the ground there.
Another question I have is if it would be possible to make something like a sword slash create a specific fault line on an object. For instance, being able to slice a circle into two parts, based on which part of the slice hit which part of the circle. For instance, say you slice a circle in to two unequal parts, slicing along the edge. Could you make that circle split into one large almost-circle, and one tiny sliver, based on the collision detection?
Furthermore, what if the circle was moving? Would it be possible to make it so that if you puncture only the center of a circle, making the sword come out of the other side, and then later create another incision all the way through the circle, perpendicular to the first slash, the circle is broken into three parts?
Again, I have never worked with bitmapData and I'm not trying to attempt it; right now I"m just curious because I've never seen a game, Flash or otherwise, break up objects in this way.
All of what you mentioned isn't necessarily hard at all, and in fact has all been done before. Whether it's been used for a game or not, I'm not sure.
A friend of mine was working on a game that was never finished that had all that. You could accurately slice bits and pieces of any object or ground and it would all fall realistically (he even somehow got around to making convex shapes which I thought wasn't possible in box2d, probably joining several shapes).
So yeah, just use a physics engine and with some creative thinking, it shouldn't be that hard.