SCRATCH TUTORIAL SPACE SHUTTLE MISSION STS-2020
Lesson 16 Add Scripts to the Alien Spaceship
- Description:
We want the Alien Spaceship to move across the top of the Stage.
When the Missile hits it, stop and change costumes, add 5 points to the score.
We need a variable to tell the Alien Space to stop when the Missile hits it.
If the Alien Spaceship touches the Astronaunt, subtact 5 points from the score and broadcast message gameover.
If you haven't already, Launch the Scratch program from your desktop. - Let's get started!!!
- We will be using background 5, spacebg. Click on the Stage icon, Select the spacebg.
Click on the tab.
- Add blocks to the Alien Spaceship script.
In the script block area click on the button
Click on the button
We do not want the Stop variable to show on the Stage.
Click inside the check box to uncheck it
The Stop variable is like a switch, 0 is off (stop), 1 is on (go). We need it to tell the Alien spaceship to stop moving when it is hit by the missile. Let's make a new costume for when the Alien spaceship is hit by the missile.
Click on the tab.
Click on the Copy button.
On the New Costume, costume2, Click on the Edit button.
Make the spaceship look like it was hit by the missile. I used the Eraser to break it up.
When you are done, click OK
Let's add the blocks to the script
Click on the tab.
Grab these blocks and Snap to the the Start stack
Let' add a script to tell the Alien spaceship what to do when it recieves the message hit
Add some color effects, switch to costume2 and set Stop variable to 0.
Grab and Snap these blocks together, to create the Script.
Let' add a script to tell the Alien spaceship what to do when it recieves the message mayday
Show the Alien spaceship
Grab and Snap these blocks together, to create the Script.
Move the Alien spaceship across the top of the Stage, until it touches the Astronaut or the Stop variable equals 0.
Grab and Snap these blocks together, to create the Script.
Tell Alien spaceship what to do if it touches the Astronaut.
Subtract 5 from the score, broadcast the message, gameover.
Grab and Snap these blocks and add to the Stack.
Test: To test all the scripts, click on the Start flag in the top right corner Let's update our notes.
In the top right corner click on the Notepad.
Add Press the spacebar to fire Missiles
Click OK
- Finished Lesson 16
- Start Lesson 17 Add Scripts for Game Over