Today in Scratch you will build Rocket Lander: a game where gravity pulls the rocket down, thrust and fuel are controlled with variables, and you try for a fair landing on the ship.
You can already move sprites and run a green-flag project. We will predict, build step by step, run the game, and fix what breaks.
Before you run anything: what do you think will happen to the rocket when gravity is on and you have not pressed thrust yet?
Keep this short. Devices on Scratch, students logged in. Optional predict: before anyone runs code, ask what the rocket will do under gravity with no thrust. Note a few answers to revisit in make sense. Then move straight into the build; pair students if that is your usual setup.
Unlike most rockets that get launched into space, which can never be used again can never be used, the Falcon 9 is capable of re-entering the atmosphere and landing vertically. This feat was achieved for the first time on flight 20 in December 2015.
As the flight number 20 suggests, there were many tests and attempts before flight number 20 that weren't successful! Don't worry though all these rockets are unmanned and are either piloted by computers and remotely from the mission control center.
If you are interested in learning more about SpaceX and their rockets, take a look at the videos below:
SpaceX launches explained
Credit Supercluster Science YouTube Channel.
Landing on land
Credit SciNews YouTube Channel.
Credit Bloomberg Quicktake YouTube Channel.
Brief context only. Read or paraphrase the Falcon 9 landing idea so students know why a vertical lander matters. Do not let this eat build time; link it to the game goal of a controlled landing.
We're going to create a game where we need to pilot a rocket landing!
Open this starter project in Scratch, it has a background, a Falcon 9 rocket sprite and a ship sprite already added.
Have the starter link ready on the board. Check every student has the project open with background, rocket and ship sprites visible. If remix or sign-in blocks anyone, sort that before coding starts.
When a rocket enters back into Earth's atmosphere, gravity will start to pull it downwards. We can simulate this in code by changing the Y position of the sprite.
Add the following code to the rocket sprite to make it:
when green flag clicked
go to x (0) y (200)
point in direction (0)
forever
change y by (-5)
end
Model on the board: green flag, go to top centre, point straight up, forever change y down. Key question: why does the rocket fall on its own? Watch for change y on the wrong sprite or missing forever. Differentiation: support students who lose the forever loop; extension pairs can try a slightly stronger or weaker gravity value later when tuning.
Now let's program the up arrow to make the rocket fires it's booster so we can slow it down.
Add the following code to the rocket sprite.
when green flag clicked
forever
if < key (up arrow v) pressed? > then
move (8) steps
end
Model the up-arrow forever loop and the move steps value. Ask why the rocket can slow or rise when move 8 beats change y by -5. Common bug: second green-flag script forgotten, or move steps too small so thrust feels useless. Circulate and have pairs test green flag plus up arrow only.
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.