The Space X Falcon 9 rocket is capable of landing back on earth on top of a moving ship at sea, in this project we try and recreate the landing and make it into a game.
- 1 The Space X Falcon 9
- 2 Create a new Scratch project
- 3 Colour the backdrop
- 4 Add the Falcon 9 sprite
- 5 Program gravity
- 6 Program booster
- 7 Paint the rocket thrust
- 8 Show the rocket thrust
- 9 Move left
- 10 Move right
- 11 Create the ship sprite
- 12 Land on the ship
- 13 Explode
- 14 Crash into the sea
- 15 Fuel
- 16 Challenge
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.
Go to the Scratch website and create a new project.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
In this project the player will need to try and land the rocket on a ship at sea so let's design the background to have a blue sky and a dark green sea at the bottom.
Open the backdrop editor and draw 2 coloured boxes to match the example in this step.
Included with this step is a picture of the Falcon 9 rocket. Download it to your computer and then upload it into your project as a new sprite.
Change the size of the sprite to be 25%.
You can upload images and sprite files into your project. To upload a sprite follow these steps:
- First save the image or sprite file onto your computer. You do this by right clicking on the image or link and then selecting 'Save image/link as...'.
- Choose a location on your computer such as your desktop and save the file.
- In your Scratch project, put your mouse over the Choose a Sprite button.
- Click on the 'Upload Sprite' button.
- Go to the folder you saved your file.
- Select the file and click 'Open'.
The new sprite will upload into your project and appear in the stage area.
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:
- start at the top center.
- point upwards (be vertical).
- start falling.
when green flag clicked
go to x (0) y (200)
point in direction (0)
change y by (-5)
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu