Scratch exercise 01b

Scratch cat and code blocks video screenshot Scratch coding video lessons

Our Scratch coding online video lessons are an ideal way for your child to experience our lessons at home.
Try a FREE lesson.

Begin and End a game with a broadcast

Broadcasting is a way of sending a message from one script/code to another script/code. In this exercise you will broadcast from the stage to the Cat sprite.

The code/scripts you will learn here will make sure that your games will start if a player press the "B" key OR clicks the Green Flag.

This is a more professional way to begin and end your game for you and for someone who is playing it.


NOTE: You can use any version of Scratch.


Complete these steps ..


1. Open Scratch, OR create a new game (from the top menu choose "File>New").


2. Select the stage and add the following script/code to it. You will need to use the "broadcast" script/code block and create a new message "begin game" ..

.. or ..


.. or ..


Now add the "when e key pressed" script/code ..



3. Select the Cat sprite. Re-name it "Cat" and add this code/scripts ..



Press "B" on your keyboard and then the arrow keys to test your game.

Press the "E" key to end it when you are ready to continue working on your game.



4. Try changing the keys which will start and stop your game. How about "1" instead of "b" and "2" instead of "e"?



5. Use the File menu to save your game. Name it "Begin and end with a broadcast v1".



6. Well done, you've finished this tutorial!