Unit 1 · Lesson 1

Pick Up an Astronaut and Return to Base

  • Build the Rescue Systems
  • 30 minutes
  • Advanced Scratch · Ages 8–11

Start a new rescue game. Fly to an astronaut, pick them up, and bring them back to base. Save and take a break after any card.

Prerequisite: Scratch Meteor Challenge. Complete Meteor Challenge before adding rescue missions, custom blocks, and clones.

Your goal

Fly to an astronaut, pick them up and deliver them to BaseStation.

Do one step. Match the picture. Then move on.

Download the Space Rescue art. Extract the ZIP first: double-click on Mac; choose Extract All on Windows. Upload the extracted images.

  1. In Scratch

    Start a new project

    Save your other game first. Choose File → New. Delete the default cat in this new project. Name it Space Rescue Adventure.

    Actual Scratch open File menu including Load from your computer and Save to your computer.
    1. Click: Open File.
    2. Click: Choose New after saving your other game.
    Actual Scratch editor · step 1
  2. Select Stage’s thumbnail

    Select the small Stage thumbnail

    Click the small Stage picture beside the sprite list. The tab should say Backdrops. Clicking the big game preview does not select Stage.

    Actual Scratch small Stage thumbnail selected in purple beside the sprite list.
    1. Click: Click this small Stage thumbnail.
    Actual Scratch editor · step 2
  3. Select Stage’s thumbnail

    Upload the first mission

    Point at the landscape button. Choose the top up arrow: Upload Backdrop. Pick mission-1.svg from the extracted art folder. Rename it Mission 1.

    Actual Scratch landscape-button menu with the Upload Backdrop up arrow at the top and the Choose a Backdrop landscape button at the bottom.
    1. Click: Choose the top arrow to upload a backdrop.
    Actual Scratch editor · step 3
  4. Select Stage’s thumbnail

    Add missions 2 and 3

    Upload mission-2.svg → Mission 2, then mission-3.svg → Mission 3. Delete only the unused white backdrop1. Keep the three mission pictures in order.

    Actual Scratch Stage backdrops reference.
    1. Check: Keep Mission 2 and Mission 3 in order.
    2. Click: Open Backdrops.
    Actual Scratch editor · step 4
  5. Select Stage’s thumbnail

    Add two success screens

    Upload mission-complete.svg → Mission complete. Upload adventure-won.svg → Adventure complete. Copy the names and spaces exactly.

    Actual Scratch Stage backdrops reference.
    1. Check: Check both success backdrop names.
    2. Click: Keep the Backdrops tab open.
    Actual Scratch editor · step 5
  6. Select Stage’s thumbnail

    Add the losing screens

    Upload out-of-lives.svg → Out of lives, then time-is-up.svg → Time is up. You should have seven backdrops. Select Mission 1 again.

    Actual Scratch Stage backdrop endings reference.
    1. Check: Keep both losing backdrops at the end.
    2. Click: Scroll up to select Mission 1 again.
    Actual Scratch editor · step 6
  7. In Scratch

    Upload the rescue base

    Use the cat button’s top up arrow: Upload Sprite. Choose base-station.svg. Name it BaseStation. Set x 0, y -140, Size 100 and Direction 90.

    Actual Scratch BaseStation selected, with its name, x, y and Size fields below the game preview.
    1. Click: Check the sprite name.
    2. Click: Set x and y as shown.
    3. Click: Set the sprite size.
    Actual Scratch editor · step 7
  8. Select BaseStation

    Upload the rescue sound

    Open Sounds. Use Upload Sound for catch.wav. Rename the sound Rescue. We will use it after a delivery.

    Actual Scratch open speaker menu with the Upload Sound up arrow at the top, Record microphone and Choose a Sound magnifying glass below.
    1. Click: Choose the top arrow to upload a sound.
    Actual Scratch editor · step 8
  9. In Scratch

    Upload the spaceship

    Use Upload Sprite for spaceship.png. Name it Spaceship. Set x 0, y -130, Size 60 and Direction 90.

    Actual Scratch Spaceship selected, with its name, x, y and Size fields below the game preview.
    1. Click: Check the sprite name.
    2. Click: Set x and y as shown.
    3. Click: Set the sprite size.
    Actual Scratch editor · step 9
  10. In Scratch

    Upload the astronaut

    Use Upload Sprite for astronaut.svg. Name it Astronaut. Set x -120, y 20, Size 90 and Direction 90.

    Actual Scratch Astronaut selected, with its name, x, y and Size fields below the game preview.
    1. Click: Check the sprite name.
    2. Click: Set x and y as shown.
    3. Click: Set the sprite size.
    Actual Scratch editor · step 10
  11. Select Astronaut

    Add the pickup sound

    Open Sounds. Upload catch.wav here too. Rename it Rescue. Each sprite needs its own sound upload.

    Actual Scratch open speaker menu with the Upload Sound up arrow at the top, Record microphone and Choose a Sound magnifying glass below.
    1. Click: Choose the top arrow to upload a sound.
    Actual Scratch editor · step 11
  12. In Scratch

    Upload the restart button

    Use Upload Sprite for start-restart.svg. Name it Start / Restart. Set x 155, y 150, Size 100 and Direction 90.

    Actual Scratch Start / Restart selected, with its name, x, y and Size fields below the game preview.
    1. Click: Check the sprite name.
    2. Click: Set x and y as shown.
    3. Click: Set the sprite size.
    Actual Scratch editor · step 12
  13. Select Stage’s thumbnail

    Make GameState

    Choose Code → Variables → Make a Variable. Type GameState, then OK. Variables made on Stage are shared by all sprites. Leave cloud storage off.

    Scratch New Variable dialog on Stage: GameState typed into the name box, available to all sprites.
    1. Click: Type GameState exactly.
    2. Click: Click OK.
    Actual Scratch editor · step 13
  14. Select Stage’s thumbnail

    Make five more variables

    Make Mission, Goal, Carrying, RescuedMission and TotalRescued. Use a separate Make a Variable dialog for each name. Keep the capital letters.

    Actual Scratch Variables palette with Stage selected in Pick Up and Deliver Astronauts.
    1. Click: Make each of the five named variables.
    2. Keep: Keep Variables selected.
    Actual Scratch editor · step 14
  15. Select Stage’s thumbnail

    Choose the visible counters

    Tick Goal, Carrying, RescuedMission and TotalRescued. Untick the others. We set the numbers with blocks below; a checkbox only shows or hides a counter.

    Actual Scratch Variables palette with Stage selected in Pick Up and Deliver Astronauts.
    1. Click: Show Carrying.
    2. Click: Show Goal.
    3. Click: Show RescuedMission.
    4. Click: Show TotalRescued.
    Actual Scratch editor · step 15
  16. Select Stage’s thumbnail

    Make the first message names

    In Events, open a broadcast dropdown → New message. Create new game, prepare mission and reset world. Use these exact spaces.

    Actual Scratch New Message dialog and name field.
    1. Click: Type the exact message name.
    2. Click: Click OK.
    Actual Scratch editor · step 16
  17. Select Stage’s thumbnail

    Make the play and delivery messages

    Repeat New message for play mission, rescue delivered and mission clear. Messages let the sprites talk to each other.

    Actual Scratch New Message dialog and name field.
    1. Click: Type the exact message name.
    2. Click: Click OK.
    Actual Scratch editor · step 17
  18. Select Stage’s thumbnail

    Make the remaining messages

    Create end mission, next mission and player hit. These last two will be used in later lessons.

    Actual Scratch New Message dialog and name field.
    1. Click: Type the exact message name.
    2. Click: Click OK.
    Actual Scratch editor · step 18
  19. Select Stage’s thumbnail

    Start a game with the green flag

    Build a separate when green flag clicked → broadcast new game stack. Use ordinary broadcast.

    Actual Scratch close-up of Stage's Code area: when green flag clicked; broadcast [new game].
    1. Add: Start a game with the green flag.
    Actual Scratch editor · step 19
  20. Select Stage’s thumbnail

    Start the new game stack

    Build when I receive new game. Add Control → stop, choosing other scripts in sprite. Then add set GameState to resetting.

    Actual Scratch Stage newgame reference.
    1. Add: Start with the receive, stop, and GameState blocks.
    Actual Scratch editor · step 20
  21. Select Stage’s thumbnail

    Set the first mission and total

    Under GameState, add set Mission to 1 and set TotalRescued to 0. Type into the white inputs on the orange set blocks.

    Actual Scratch Stage newgame reference.
    1. Add: Set Mission to 1 and TotalRescued to 0.
    Actual Scratch editor · step 21
  22. Select Stage’s thumbnail

    Prepare the mission

    Finish that stack with broadcast prepare mission. Now make a separate when I receive prepare mission stack.

    Actual Scratch Stage newgame reference.
    1. Add: Broadcast prepare mission last.
    Actual Scratch editor · step 22
  23. Select Stage’s thumbnail

    Reset before playing

    Under receive prepare mission, add stop other scripts in sprite → set GameState to resetting → broadcast reset world and wait. Keep this exact order.

    Actual Scratch close-up of Stage's Code area: when I receive [prepare mission]; stop [other scripts in sprite]; set [GameState] to (resetting); broadcast [reset world] and wait; set [Goal] to (2); set [RescuedMission] to (0); set [Carrying] to (0); if <Mission = 1> then / else; switch backdrop to [Mission 1]; if <Mission = 2> then / else; switch backdrop to [Mission 2]; switch backdrop to [Mission 3].
    1. Add: Build these four reset instructions first.
    Actual Scratch editor · step 23
  24. Select Stage’s thumbnail

    Set the mission values

    Next add set Goal to 2, set RescuedMission to 0 and set Carrying to 0. Carrying 0 means there is no passenger aboard.

    Actual Scratch close-up of Stage's Code area: when I receive [prepare mission]; stop [other scripts in sprite]; set [GameState] to (resetting); broadcast [reset world] and wait; set [Goal] to (2); set [RescuedMission] to (0); set [Carrying] to (0); if <Mission = 1> then / else; switch backdrop to [Mission 1]; if <Mission = 2> then / else; switch backdrop to [Mission 2]; switch backdrop to [Mission 3].
    1. Add: Add the three mission values next.
    Actual Scratch editor · step 24
  25. Select Stage’s thumbnail

    Pick mission 1’s backdrop

    Next add if/else. Use Operators → = to ask Mission = 1. Put switch backdrop to Mission 1 in its top opening.

    Actual Scratch close-up of Stage's Code area: when I receive [prepare mission]; stop [other scripts in sprite]; set [GameState] to (resetting); broadcast [reset world] and wait; set [Goal] to (2); set [RescuedMission] to (0); set [Carrying] to (0); if <Mission = 1> then / else; switch backdrop to [Mission 1]; if <Mission = 2> then / else; switch backdrop to [Mission 2]; switch backdrop to [Mission 3].
    1. Add: Test Mission 1 and choose its backdrop.
    Actual Scratch editor · step 25
  26. Select Stage’s thumbnail

    Pick the other mission backdrops

    Inside that else, add another if/else. Test Mission = 2. Put Mission 2 in its top opening and Mission 3 in its else.

    Actual Scratch close-up of Stage's Code area: when I receive [prepare mission]; stop [other scripts in sprite]; set [GameState] to (resetting); broadcast [reset world] and wait; set [Goal] to (2); set [RescuedMission] to (0); set [Carrying] to (0); if <Mission = 1> then / else; switch backdrop to [Mission 1]; if <Mission = 2> then / else; switch backdrop to [Mission 2]; switch backdrop to [Mission 3].
    1. Add: Nest the Mission 2 check inside else.
    Actual Scratch editor · step 26
  27. Select Stage’s thumbnail

    Tell the sprites to play

    Below the whole backdrop if/else, add set GameState to playing → broadcast play mission. Do not use broadcast and wait for play mission: its movement loops keep running.

    Actual Scratch close-up of Stage's Code area: set [GameState] to (playing); broadcast [play mission].
    1. Add: Build this Stage code stack.
    Actual Scratch editor · step 27
  28. Select Stage’s thumbnail

    Show a completed mission

    Build a separate receive mission clear → if GameState = between. Inside it: switch backdrop to Mission complete → broadcast end mission and wait.

    Actual Scratch Stage missionclear reference.
    1. Add: Show a completed mission.
    Actual Scratch editor · step 28
  29. Select Spaceship

    Reset the ship

    Build receive reset world → stop other scripts in sprite → hide → say an empty message → clear graphic effects → go to x 0 y -130.

    Actual Scratch close-up of Spaceship's Code area: when I receive [reset world]; stop [other scripts in sprite]; hide; say []; clear graphic effects; go to x: (0) y: (-130).
    1. Add: Build this Spaceship message stack.
    Actual Scratch editor · step 29
  30. Select Spaceship

    Start the flying loop

    Build a separate receive play mission → show → forever → if GameState = playing. Put the movement blocks inside this if.

    Actual Scratch Spaceship shipplay reference.
    1. Add: Start the show, forever, and playing check.
    Actual Scratch editor · step 30
  31. Select Spaceship

    Move right and left

    Inside GameState = playing, add if key right arrow pressed? → change x by 7. Below it, add if key left arrow pressed? → change x by -7.

    Actual Scratch close-up of Spaceship's Code area: if <GameState = playing> then; if <key [right arrow] pressed?> then; change x by (7); if <key [left arrow] pressed?> then; change x by (-7); if <key [up arrow] pressed?> then; change y by (7); if <key [down arrow] pressed?> then; change y by (-7); if <x position > 210> then; set x to (210).
    1. Add: Add right and left arrow checks.
    Actual Scratch editor · step 31
  32. Select Spaceship

    Move up and down

    Below the left-arrow if, add if key up arrow pressed? → change y by 7. Then add if key down arrow pressed? → change y by -7.

    Actual Scratch close-up of Spaceship's Code area: if <GameState = playing> then; if <key [right arrow] pressed?> then; change x by (7); if <key [left arrow] pressed?> then; change x by (-7); if <key [up arrow] pressed?> then; change y by (7); if <key [down arrow] pressed?> then; change y by (-7); if <x position > 210> then; set x to (210).
    1. Add: Add up and down arrow checks.
    Actual Scratch editor · step 32
  33. Select Spaceship

    Stop at the right edge

    Below the four arrow checks, add if x position > 210 → set x to 210. Keep it inside GameState = playing.

    Actual Scratch close-up of Spaceship's Code area: if <GameState = playing> then; if <key [right arrow] pressed?> then; change x by (7); if <key [left arrow] pressed?> then; change x by (-7); if <key [up arrow] pressed?> then; change y by (7); if <key [down arrow] pressed?> then; change y by (-7); if <x position > 210> then; set x to (210).
    1. Add: Clamp the right edge at x 210.
    Actual Scratch editor · step 33
  34. Select Spaceship

    Stop at the other three edges

    Add three separate checks: x position < -210 → set x -210; y position > 125 → set y 125; y position < -155 → set y -155.

    Actual Scratch close-up of Spaceship's Code area: if <x position < -210> then; set x to (-210); if <y position > 125> then; set y to (125); if <y position < -155> then; set y to (-155).
    1. Add: Build this Spaceship code stack.
    Actual Scratch editor · step 34
  35. Select Spaceship

    Show a passenger message

    Below the edge checks, add if/else Carrying = 1. Top opening: say Passenger aboard! Else: say an empty message. Keep it in the same movement loop.

    Actual Scratch Spaceship shipcarry reference.
    1. Add: Show a passenger message.
    Actual Scratch editor · step 35
  36. Select Spaceship

    Stop the ship at an ending

    Build a separate receive end mission → stop other scripts in sprite → hide → say an empty message → clear graphic effects.

    Actual Scratch Spaceship shipend reference.
    1. Add: Stop the ship at an ending.
    Actual Scratch editor · step 36
  37. Select Astronaut

    Reset the astronaut

    Build receive reset world → stop other scripts in sprite → hide → say an empty message. Add go to x pick random -190 to 190, y pick random 0 to 45.

    Actual Scratch Astronaut astronautreset reference.
    1. Add: Reset the astronaut.
    Actual Scratch editor · step 37
  38. Select Astronaut

    Start the pickup loop

    Build a separate receive play mission → show → forever → if. We will put three checks into the if’s question.

    Actual Scratch Astronaut astronautplay reference.
    1. Add: Start the astronaut loop with an empty if.
    Actual Scratch editor · step 38
  39. Select Astronaut

    Ask whether pickup is allowed

    Put and in the question. Left: GameState = playing. Right: another and containing Carrying = 0 and touching Spaceship?. Find touching in Sensing.

    Actual Scratch close-up of Astronaut's Code area: show; if <<GameState = playing> and <<Carrying = 0> and <touching [Spaceship]?>>> then; set [Carrying] to (1); hide; start sound [Rescue].
    1. Add: Build the three pickup checks with and.
    Actual Scratch editor · step 39
  40. Select Astronaut

    Put the passenger aboard

    Inside that if, add set Carrying to 1 → hide → start sound Rescue. The astronaut hides because the passenger is now aboard the ship.

    Actual Scratch close-up of Astronaut's Code area: show; if <<GameState = playing> and <<Carrying = 0> and <touching [Spaceship]?>>> then; set [Carrying] to (1); hide; start sound [Rescue].
    1. Add: Set Carrying, hide, and play the pickup sound.
    Actual Scratch editor · step 40
  41. Select Astronaut

    Send another astronaut after delivery

    Build a separate receive rescue delivered → if GameState = playing. Inside it, go to the same random x and y ranges, then show.

    Actual Scratch Astronaut delivered reference.
    1. Add: Send another astronaut after delivery.
    Actual Scratch editor · step 41
  42. Select Astronaut

    Hide the astronaut at an ending

    Build receive end mission → stop other scripts in sprite → hide. Keep this stack separate.

    Actual Scratch Astronaut actorend reference.
    1. Add: Hide the astronaut at an ending.
    Actual Scratch editor · step 42
  43. Select BaseStation

    Reset the base

    Build receive reset world → stop other scripts in sprite → hide → go to x 0 y -140. This stack must finish; do not add forever here.

    Actual Scratch BaseStation basereset reference.
    1. Add: Reset the base.
    Actual Scratch editor · step 43
  44. Select BaseStation

    Start the delivery loop

    Build a separate receive play mission → show → forever → if. Keep all the delivery checks inside this if.

    Actual Scratch BaseStation baseplay reference.
    1. Add: Start the base loop and delivery if.
    Actual Scratch editor · step 44
  45. Select BaseStation

    Ask whether delivery is allowed

    Use and with GameState = playing on the left. On the right, nest another and with Carrying = 1 and touching Spaceship?.

    Actual Scratch close-up of BaseStation's Code area: if <<GameState = playing> and <<Carrying = 1> and <touching [Spaceship]?>>> then; set [Carrying] to (0); change [RescuedMission] by (1); change [TotalRescued] by (1); if <RescuedMission = Goal> then / else; set [GameState] to (between); broadcast [rescue delivered].
    1. Add: Build the three delivery checks with and.
    Actual Scratch editor · step 45
  46. Select BaseStation

    Count one delivery

    Inside that if, add set Carrying to 0 → change RescuedMission by 1 → change TotalRescued by 1. Clear Carrying first so one passenger cannot score twice.

    Actual Scratch close-up of BaseStation's Code area: if <<GameState = playing> and <<Carrying = 1> and <touching [Spaceship]?>>> then; set [Carrying] to (0); change [RescuedMission] by (1); change [TotalRescued] by (1); if <RescuedMission = Goal> then / else; set [GameState] to (between); broadcast [rescue delivered].
    1. Add: Clear Carrying before increasing both rescue counters.
    Actual Scratch editor · step 46
  47. Select BaseStation

    Check the mission goal

    Below those three blocks, add if/else RescuedMission = Goal. In the top opening, put set GameState to between → broadcast mission clear.

    Actual Scratch close-up of BaseStation's Code area: if <<GameState = playing> and <<Carrying = 1> and <touching [Spaceship]?>>> then; if <RescuedMission = Goal> then / else; set [GameState] to (between); broadcast [mission clear].
    1. Add: Check the goal and announce mission clear.
    Actual Scratch editor · step 47
  48. Select BaseStation

    Keep rescuing until the goal

    In that else, put broadcast rescue delivered. Below the whole goal if/else, add start sound Rescue. It stays inside the delivery check.

    Actual Scratch BaseStation baseplay reference.
    1. Add: Broadcast another rescue inside else; add the sound.
    Actual Scratch editor · step 48
  49. Select BaseStation

    Hide the base at an ending

    Build receive end mission → stop other scripts in sprite → hide on BaseStation too. Use the same three-block pattern as the picture.

    Actual Scratch Astronaut actorend reference.
    1. Add: Hide the base at an ending.
    Actual Scratch editor · step 49
  50. Select Start / Restart

    Show the button

    Build when green flag clicked → go to x 155 y 150 → show. This button stays available after a mission ends.

    Actual Scratch Start / Restart restart reference.
    1. Add: Show the button.
    Actual Scratch editor · step 50
  51. Select Start / Restart

    Make the button work

    Build a separate when this sprite clicked → broadcast new game. Keep the green-flag stack too.

    Actual Scratch close-up of Start / Restart's Code area: when this sprite clicked; broadcast [new game].
    1. Add: Make the button work.
    Actual Scratch editor · step 51
  52. In Scratch

    Try one pickup and delivery

    Click the green flag. Use all four arrows to touch the astronaut. Carrying becomes 1. Fly back to BaseStation: Carrying becomes 0 and both rescue counters increase.

    Actual Scratch Stage for Pick Up and Deliver Astronauts after starting its lesson checkpoint.
    1. Click: Click the green flag.
    2. Check: Watch Carrying and the rescue counters.
    3. Check: Return to this base with a passenger.
    Actual Scratch editor · step 52
  53. In Scratch

    Finish the first mission

    Deliver two astronauts. Mission complete should appear. Click Start / Restart to begin again. Meteors, lives, a timer and Next Mission come later.

    Actual Scratch Stage for Pick Up and Deliver Astronauts after starting its lesson checkpoint.
    1. Click: Click Start / Restart after completing the mission.
    Actual Scratch editor · step 53
  54. In Scratch

    Save your progress

    Choose File → Save to your computer. Name your file Space Rescue 1. Keep your own save for the next lesson.

    Actual Scratch open File menu including Load from your computer and Save to your computer.
    1. Click: Open File.
    2. Click: Choose Save to your computer.
    Actual Scratch editor · step 54
Lost your place? Optional comparison files

Save your own work first. Loading an .sb3 replaces the project on screen.

Finished lesson 1 comparison

Optional: full block guide and finished game

Build with blocks · Lesson 1

See the blocks. Try the finished game.

Build these blocks in Scratch. This guide is read-only.

Your lesson’s block guide

Choose the matching sprite in Scratch, then build its stack from top to bottom.

Indented rows fit inside the block above. else marks the second slot of one if/else block.

StageStage: when green flag clicked
  1. Eventswhen green flag clicked
  2. Eventsbroadcast [new game]
StageStage: when I receive [new game]
  1. Eventswhen I receive [new game]
  2. Controlstop [other scripts in sprite]
  3. Variablesset [GameState] to (resetting)
  4. Variablesset [Mission] to (1)
  5. Variablesset [TotalRescued] to (0)
  6. Eventsbroadcast [prepare mission]
StageStage: when I receive [prepare mission]
  1. Eventswhen I receive [prepare mission]
  2. Controlstop [other scripts in sprite]
  3. Variablesset [GameState] to (resetting)
  4. Eventsbroadcast [reset world] and wait
  5. Variablesset [Goal] to (2)
  6. Variablesset [RescuedMission] to (0)
  7. Variablesset [Carrying] to (0)
  8. Controlif <Mission = 1> then
  9. Looksswitch backdrop to [Mission 1]
  10. elseSecond slot of the same if/else block
    Controlif <Mission = 2> then
  11. Looksswitch backdrop to [Mission 2]
  12. elseSecond slot of the same if/else block
    Looksswitch backdrop to [Mission 3]
  13. Variablesset [GameState] to (playing)
  14. Eventsbroadcast [play mission]
StageStage: when I receive [mission clear]
  1. Eventswhen I receive [mission clear]
  2. Controlif <GameState = between> then
  3. Looksswitch backdrop to [Mission complete]
  4. Eventsbroadcast [end mission] and wait
SpaceshipSpaceship: when I receive [reset world]
  1. Eventswhen I receive [reset world]
  2. Controlstop [other scripts in sprite]
  3. Lookshide
  4. Lookssay []
  5. Looksclear graphic effects
  6. Motiongo to x: (0) y: (-130)
SpaceshipSpaceship: when I receive [play mission]
  1. Eventswhen I receive [play mission]
  2. Looksshow
  3. Controlforever
  4. Controlif <GameState = playing> then
  5. Controlif <key [right arrow] pressed?> then
  6. Motionchange x by (7)
  7. Controlif <key [left arrow] pressed?> then
  8. Motionchange x by (-7)
  9. Controlif <key [up arrow] pressed?> then
  10. Motionchange y by (7)
  11. Controlif <key [down arrow] pressed?> then
  12. Motionchange y by (-7)
  13. Controlif <x position > 210> then
  14. Motionset x to (210)
  15. Controlif <x position < -210> then
  16. Motionset x to (-210)
  17. Controlif <y position > 125> then
  18. Motionset y to (125)
  19. Controlif <y position < -155> then
  20. Motionset y to (-155)
  21. Controlif <Carrying = 1> then
  22. Lookssay [Passenger aboard!]
  23. elseSecond slot of the same if/else block
    Lookssay []
SpaceshipSpaceship: when I receive [end mission]
  1. Eventswhen I receive [end mission]
  2. Controlstop [other scripts in sprite]
  3. Lookshide
  4. Lookssay []
  5. Looksclear graphic effects
AstronautAstronaut: when I receive [reset world]
  1. Eventswhen I receive [reset world]
  2. Controlstop [other scripts in sprite]
  3. Lookshide
  4. Lookssay []
  5. Motiongo to x: (pick random (-190) to (190)) y: (pick random (0) to (45))
AstronautAstronaut: when I receive [play mission]
  1. Eventswhen I receive [play mission]
  2. Looksshow
  3. Controlforever
  4. Controlif <<GameState = playing> and <<Carrying = 0> and <touching [Spaceship]?>>> then
  5. Variablesset [Carrying] to (1)
  6. Lookshide
  7. Soundstart sound [Rescue]
AstronautAstronaut: when I receive [rescue delivered]
  1. Eventswhen I receive [rescue delivered]
  2. Controlif <GameState = playing> then
  3. Motiongo to x: (pick random (-190) to (190)) y: (pick random (0) to (45))
  4. Looksshow
AstronautAstronaut: when I receive [end mission]
  1. Eventswhen I receive [end mission]
  2. Controlstop [other scripts in sprite]
  3. Lookshide
BaseStationBaseStation: when I receive [reset world]
  1. Eventswhen I receive [reset world]
  2. Controlstop [other scripts in sprite]
  3. Lookshide
  4. Motiongo to x: (0) y: (-140)
BaseStationBaseStation: when I receive [play mission]
  1. Eventswhen I receive [play mission]
  2. Looksshow
  3. Controlforever
  4. Controlif <<GameState = playing> and <<Carrying = 1> and <touching [Spaceship]?>>> then
  5. Variablesset [Carrying] to (0)
  6. Variableschange [RescuedMission] by (1)
  7. Variableschange [TotalRescued] by (1)
  8. Controlif <RescuedMission = Goal> then
  9. Variablesset [GameState] to (between)
  10. Eventsbroadcast [mission clear]
  11. elseSecond slot of the same if/else block
    Eventsbroadcast [rescue delivered]
  12. Soundstart sound [Rescue]
BaseStationBaseStation: when I receive [end mission]
  1. Eventswhen I receive [end mission]
  2. Controlstop [other scripts in sprite]
  3. Lookshide
Start / RestartStart / Restart: when green flag clicked
  1. Eventswhen green flag clicked
  2. Motiongo to x: (155) y: (150)
  3. Looksshow
Start / RestartStart / Restart: when this sprite clicked
  1. Eventswhen this sprite clicked
  2. Eventsbroadcast [new game]
Download lesson 1 checkpoint

Save your current Scratch project first. Then choose File → Load from your computer and select this .sb3 file.

Open the Scratch editor ↗

Opening the editor does not load the download automatically.

Finished game preview

This is the completed game, including features from later lessons. It does not run this lesson’s checkpoint.

Choose the green flag, then use all four arrow keys inside the Scratch player. Open your checkpoint in Scratch to test the blocks for this lesson.

Open the finished game in a new tab ↗
END OF LESSON

Ready for the next step?

Return here anytime to review.

Comments

Lesson discussion

Ask a question or help a classmate. Mr. S can reply here.

Loading discussion…