4 - Bombs
a maze that is closed and add bombs and triggers to blow walls open.
The idea is that when the player gets to the trigger, all bombs explode,
destroying everything in their neighborhood.
This can be used to create holes in walls and to destroy monsters.
You will need three new objects: a trigger,
a bomb, and an explosion.
bomb is extremely simple. It just sits there and does nothing. To make
sure monsters move over it (rather than under it) we set its depth
Object instances are drawn in order of depth. The ones with the highest
depth are drawn first. So they will lie behind instances with a smaller
By setting the depth of the bomb to 10 the other objects, that have
a default depth of 0, are drawn on top of it.
the trigger and the person collide we will turn all the bombs into explosions.
You can do this on the person or the trigger.
explosion object to show
the animation. After the animation, it destroys itself. (You have to
be careful that the origin of the explosion is at the right place when
turning a bomb into it. Try 32 x 32 first) The object also must destroy
everything it touches. This requires a little bit of work. First of
all, we do not want the explosion to destroy itself so we move it temporarily
out of the way. Then we use actions to destroy all instances at positions
around the old position of explosion. Finally we place the explosion
back at the original place.
each wall indicate the type of wall under object and the position of
sure the triggers are not next to the bombs.
is important to carefully design the levels with the bombs and triggers,
so that they present interesting challenges. You mark will be based
in part on the layout of the level.