Unpredictable Explosions
|
You won't find a better explosion in a game than one that's unpredictable. They're more realistic, add more tension, and add a degree of variance to the game. Great, classic Klik games such as Destruction Carnival and Factor X use unpredictable explosions to make a volatile and dangerous environment around their central characters.
So, you wanna know how to make them, right? Well, obviously... because you wouldn't be here otherwise. How to make an unpredictable explosion is written below:
- You need to draw or choose an explosion that will be used in your unpredictable chain explosion. Good ones to make are symmetrical ones, as they look best when this method of explosion occurs. Make sure that the explosion object has only one animation, and that the animation is under the STOPPED heading. Do NOT make the animation loop. Call it 'Explosion'. Make sure that each in frame of the explosion's animation, the hot spot is in the center (use the coordinates for a guide). In this guide, the explosion object is (32, 32) pixels big and therefore has a center of (16, 16).
- To make an explosion, you'll need something to make the explosion with. This should be something like a missile or a grenade. In this example, the object is "Missile" and has dimesions of (64, 32). The center of this object is (32, 16).
- Something for "Missile" to hit is also a good idea. In this tutorial, the object is "Enemy". The size of the enemy does not matter.
- Create a 3x3 active object, with the hot spot and action point set to (1,1). It can be any colour. Place it out of the playing field and rename it to "Explosion Maker". This is just for future reference. The object should have a Bouncing Ball movement and should have a speed of about 10 to 20. Initial directions should all be full. Make it invisible, too. If you're using KnP, do so with a 'start of level' condition.
- Make the following conditions and events
CONDITIONS:
Animation Stopped has finished playing (for 'Explosion')
EVENTS:
Destroy 'Explosion'
[ This makes the explosion object disappear after its blowing up animation is finished. ]
CONDITIONS:
Always
EVENTS:
Add 1 to Alterable Value A of 'Explosion Maker'
Add 1 to Alterable Value B of 'Explosion Maker'
[ This makes an in-game timer for each seperate Explosion Maker and allows you to program lines according to the amount of time an individual Explosion Maker has been in the game. ]
CONDITIONS:
Alterable Value A of 'Explosion Maker' = 40
EVENTS:
Create 'Explosion' at (16, 16) relative to 'Explosion Maker'
Play sample <explosion sound here>
Set direction of "Explosion Maker" to a random direction, out of 32. [ Remove this line for more predictable explosions. ]
Set Alterable Value A of 'Explosion Maker' to 0.
[ Makes each Explosion Maker create an explosion every 40 milliseconds that it's 'alive'. ]
CONDITIONS:
Alterable Value B of 'Explosion Maker' = 100
EVENTS:
Destroy 'Explosion Maker'
[ This makes the explosion maker destroy itself once it has existed for 100 milliseconds. ]
CONDITIONS:
"Missile" collides with "Enemy"
EVENTS:
Create "Explosion Maker" at (32,16) relative to "Missile"
Create "Explosion Maker" at (32,16) relative to "Missile"
Create "Explosion Maker" at (32,16) relative to "Missile"
Create "Explosion Maker" at (32,16) relative to "Missile"
Create "Explosion Maker" at (32,16) relative to "Missile"
Create "Explosion" at (32, 16) relative to "Missile"
Destroy "Missile"
[ This makes "Missile" start 5 explosion chains when it hits "Enemy", makes an explosion directly on the missile iteself, and then remove itself from the game. ]
- Now when you run the level and watch the missile hit the object, the explosion spreads in a random and unpredictable way. Press F2 to run the level again and wach as the explosion is different. Keep doing it, the explosion is random each time.
Note: I'm not sure if this is a global problem, but TGF doesn't seem to recognise "Animation STOPPED has finished playing" events on my computer. All you need to do is paste the animation into one of the user animation slots, and have just the first frame of the animation as the STOPPED animation. Then, replace the "Animation Stopped is over" event with the following events:
CONDITIONS:
Always
EVENTS:
Change animation sequence of 'Explosion' to 'User Animation 1'.
CONDITIONS:
Animation 'User Animation 1' is finished
EVENTS:
Destroy 'Explosion'
- Rick
|
|
|