Home

Home

 Print This Lesson


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 the tab.

  • Create the script.
Grab these blocks and Snap together.



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 tab.

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.
Click on the tab.
Grab these blocks and Snap to the stack.

  • Add special effects to the background.
Grab these blocks Snap them together.

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.
Grab these blocks Snap them together.



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 Shuttle icon.
Click on the tab.
Grab these blocksSnap to the stack.


Click on the docking light icon.
Click on the tab.

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