Author Topic: Explosions!  (Read 878 times)

Akki

  • Member
  • **
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Explosions!
« on: Mon, Oct 1, 2012 »
Hey guys, so here I am, working on my game and stuff like that and out of a sudden I ask myself "Hey, why don't I add explosions!?". So I got my pen & paper and started planning and found out these major issues and I was thinking if you could help me solve them :

a) How to appropriately resize the collision box of the explosion, since it will start out small and chaoticly grow into a bigger ball 'o death.
b) Should I use my own assets for explosion ( does that mean I have to draw every single frame of it growing? do I keep resizing its collision box after each frame then? ) or try to draw circles and add some kind of awesome filter or color swatch to manipulate it into looking like it?
c) Is it hard to pull it off?

Since there are so many things happening in my game already (poison clouds,piercing lances, minions, towers, 14 different spells so far and so on) I just want to rely on this one through the support from the forum people, who have the right knowledge on this !

Oh this game is a 2D sidescrolling, just to clarify at what way you should see the explosion.

If anyone had played Super Crate Box, you could see that the explosions are kinda simple, but nevertheless quite good (of course it depends on the style of the artwork), whereas Little Fighter 2 use really nice looking and beautiful explosions. I am just pointing these out(!free!) games, because they approach different art style on explosions, but both embrace the same concept, I know you will probably tell me that this depends by my own taste, but maybe you know how to achieve these effects without the use of artwork, just simply relying on draw code?

P.S. Attached files or examples or links would be nice, I googled, but haven't came up with fruity results :/

LaughingLeader

  • Member
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
    • LaughingLeader Blog
Re: Explosions!
« Reply #1 on: Tue, Oct 2, 2012 »
a) How to appropriately resize the collision box of the explosion, since it will start out small and chaoticly grow into a bigger ball 'o death.
b) Should I use my own assets for explosion ( does that mean I have to draw every single frame of it growing? do I keep resizing its collision box after each frame then? ) or try to draw circles and add some kind of awesome filter or color swatch to manipulate it into looking like it?
That depends entirely on how you want to create your explosions. If you go for a hand-drawn spritesheet for your explosion animation, then I would probably keep the width and height of your collision box the max size of your sprite (meaning the max size of each frame). Then I would do a pixel-perfect collsion check once something overlaps it (if you want things to take damage from the explosion and whatnot).

You could choose to make your collision box relevant to each frame (like frame 0 is 100x100, frame 6 is 300x300, etc), but that could became a bit difficult to deal with since you'll have to manipulate the offsets to get it positioned where you want.

Another option could be that you could make your explosion with a FlxEmitter (or mix using a FlxEmitter and an animated sprite). That's another easier option, since you'll be checking overlap/collision from the particles themselves.

c) Is it hard to pull it off?

That depends on how complex you want to make it. But normally, it shouldn't be difficult at all. Explosions are really just a pre-drawn sprite or an emitter that shoots out particles.