Explosions and things.
Ok here is my next article.A few ways to do explosions.
Ok this will make an explosion that can only go out so far.
First of all draw your explosion (only one explosion small or big).Then after you have it animated do this.
Say we were fighting a boss and its health reached zero.Make the boss stop everything it does and then heres a good explosion code.
every however long you want plus boss health = 0
Create explosion outside of play area.Explosion is out of play area.(Say the bosses size was x100 by y80)
Set explosion x to x boss + random(50)-random(100)
Set explosion y to y boss +random (40)-random(80)
Explosion animation has finished destroy explosion.
You may have to tweak this depending on where your hot spot and action spots are.
Heres another one.Say its an overhead game and you throw a grenade or you just want a rising and spreading explosion.
Collision between object and whatever destroys it.
Create however many of the mini explosions at it and do this code.
Always set explosion x to explosion x-random(50)+random(100)
Always set explosion y to explosion y-random(50)+random(100)
This is a pretty easy effect.
One very easy effect is to make one explosion with an action and hot spots at 0,0 (top left corner) then make an explosion object that is always invisible and will be placed at your things that explode after they explode.
Now after the thing you want to explode is destroyed do this
Value a of explosion object=0
+ value b of explosion object=0
Set explosion object value a to however many mini explosions you want to be created
Then set value b to one so it doesnt loop forever.
Then value a of explosion object=0
+ value b of explosion object=1
destroy explosion object
Value a of explosion object is greater than 0
sub one to value a create explosion(dont forget the explosion must have 32 directions to be the best,but you can make em 16 or 8 or 4)at 0 0 from explosion object.
Explosion animation is over destroy explosion
Explosion value a=0 set value a to 1 set direction to all directions.
Well there are some pretty easy exploding effects.Hope this helps some1.