Game Development Reference
In-Depth Information
Engage thrusters
Let's first write the scripts to place the bomb:
1. We can copy the
createMaze
listener script from another sprite.
2.
To this script, add a
set size to () %
block as follows:
I used
50
for the value, but if your sprite was drawn bigger or smaller, you might need
another value. Just experiment unil the bomb its the maze.
Then, we add another keyboard control to place a bomb using the following steps:
1. Start the script with a
when <b> key pressed
block.
2. We will make the bomb sprite to go to the cat by seing the
go to <cat>
block.
3. Then, set the
show
block to show the bomb sprite.
4. We have a countdown to detonaion with a few messages as follows:
say (3) for (1) secs
say (2) for (1) secs
say (1) for (1) secs
At this point, we need another message for the explosion event. For this, perform the
following steps:
1.
Add a
broadcast <>
block and create a new message called
createHole
.
2.
Then, go on to make the
say (KABOOOOM!) for (0.5) secs
.