SCRATCH TUTORIAL SPACE SHUTTLE MISSION STS-2020
Lesson 9 Create Scripts to change backgounds and add sound.
- Description.
To start the game we want to show the title background.
Then we wait a few seconds and switch to the shuttle launch backgroung.
Add sound and some effects to the background, wait a few seconds and then switch to the freedom space station backgound.
If you haven't already, Launch the Scratch program from your desktop. - Let's get started!!!
- Click on the Stage icon.
Click on thetab.
- Create the script.

Read the script.
When the game start flag is clicked, switch to background titlebg.
Wait 3 seconds.
Switch to background shuttlelaunchbg.

- Add some sound.

Click on the Import button.

Click on Music Loops, then click OK.

Click on aMusic Title, when you find one you like, click OK.
I picked Medieval1.

We have a new sound added to the sounds tab.


- Add the new sound to our background.

Grab these blocks and Snap to the stack.


- Add special effects to the background.

We had to create this script so the effects would change at the same time the music is playing.
The script reads:
When it recieves the message shuttlelaunchbg, change the color by 50, and repeat 50 times.
Then switch to the freedombg and clear rhe graphic effects.

- Create the script to change to the workingingspacebg when the shuttle is docked.

The script reads:
When it recieves the message docked, then switch to the workinginspacebg.

We are done for now. We will add more scripts later.

Test: Play the game and make sure everything is working.
Click on the Start Flag at the top right corner to run all the scripts.


- OOPs we need to move the shuttle and hide the docking light.
Click on the

Grab these blocksSnap to the stack.


Click on the docking light icon.
Click on the

To hide the docking light. Grab this block Snap to the stack.


- Finished Lesson 9
- Start Lesson 10 Create an Astronaut Sprite