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.
![](images/scrshot109.png)
Read the script.
When the game start flag is clicked, switch to background titlebg.
Wait 3 seconds.
Switch to background shuttlelaunchbg.
![](images/saveicon.png)
- Add some sound.
![](images/but_sounds.png)
Click on the Import button.
![](images/scrshot110.png)
Click on Music Loops, then click OK.
![](images/scrshot111.png)
Click on aMusic Title, when you find one you like, click OK.
I picked Medieval1.
![](images/scrshot112.png)
We have a new sound added to the sounds tab.
![](images/scrshot113.png)
![](images/saveicon.png)
- Add the new sound to our background.
![](images/but_scripts.png)
Grab these blocks and Snap to the stack.
![](images/scrshot114.png)
![](images/saveicon.png)
- Add special effects to the background.
![](images/scrshot115.png)
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.
![](images/saveicon.png)
- Create the script to change to the workingingspacebg when the shuttle is docked.
![](images/scrshot116.png)
The script reads:
When it recieves the message docked, then switch to the workinginspacebg.
![](images/saveicon.png)
We are done for now. We will add more scripts later.
![](images/scrshot117.png)
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.
![](images/scrshot118.png)
![](images/saveicon.png)
- OOPs we need to move the shuttle and hide the docking light.
Click on the
![](images/but_scripts.png)
Grab these blocksSnap to the stack.
![](images/scrshot119.png)
![](images/saveicon.png)
Click on the docking light icon.
Click on the
![](images/but_scripts.png)
To hide the docking light. Grab this block Snap to the stack.
![](images/scrshot120.png)
![](images/saveicon.png)
- Finished Lesson 9
- Start Lesson 10 Create an Astronaut Sprite