User Guide

99
3. From the Blocks Palette, drag a broadcast block
over to the Scripts Area and snap it into position
underneath the when <green flag> clicked block.
4. On the broadcast block, click the down arrow, and
then click new…
5. In the Message name box, type StartGame and
then click OK.
You can use the brightness effect to create a simple fade-in
animation. You can see this script in Figure 1, in the when I
receive StartGame scripts.
The when <green flag> clicked block is currently the only place
where the game is started. But later, other sprites can broadcast
“StartGame” to reset the project.
To finish the title screen, you need to detect when the user
presses the Space key and then broadcast a message to tell the
first level to start. You could also make the “Press Space” sprite
flash and play a sound effect when this happens.
To detect the key press:
1. In the Sprite List, click PressSpace.
2. In the Blocks Palette, click Control, and then drag
a wait until block over to the Scripts Area and snap
it into position below the repeat block.
3. In the Blocks Palette, click Sensing, and then drag
a key space pressed block over to the Scripts Area
and drop it onto the six-sided slot on the wait until
block.
4. In the Blocks Palette, click Control, and then drag
a broadcast block over to the Scripts Area. Snap it
into position below the previous block.
5. On the broadcast block, click StartGame and then
click new…
6. In the Message name box, type Level1 and then
click OK.