Be a Supporter!

Programming Nightmares

  • 339 Views
  • 2 Replies
New Topic Respond to this Topic
Kwing
Kwing
  • Member since: Jul. 24, 2007
  • Offline.
Forum Stats
Member
Level 44
Game Developer
Programming Nightmares May. 19th, 2012 @ 03:22 PM Reply

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.


If I offer to help you in a post, PM me to get it. I often forget to revisit threads.
Want 180+ free PSP games? Try these links! - Flash - Homebrew (OFW)

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Online!
Forum Stats
Supporter
Level 16
Game Developer
Response to Programming Nightmares May. 19th, 2012 @ 03:49 PM Reply

Use NAPE. Make your life easier.

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to Programming Nightmares May. 19th, 2012 @ 04:30 PM Reply

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.