Lesson 3 - Visual, level 3
Show the example. Note that the game ends when the planet has dropped 10 times, or when there have been 3 crashes. Children analyse how the code is working and share ideas. Draw attention to the variables "score" and "lives". Explain that sprites communicate with each other using the "broadcast" block. (see video)
Load the template. This is a simple version of the game without the "lives" variable and it does not decrease the score when the rocket crashes.
Task 1. Add in code to decrease the score by 3 when the rocket crashes. (Use the "set score to" block).
Task 2. Add in a "lives" variable so that the game ends after 3 crashes. (They will need to broadcast "game over" when lives is equal to 0).
Children can "clone" the planet sprite and change it to a different planet. They can then experiment with the code so the object of the game is to hit the new planet. Look at the example "planet strike" and try making various changes to it.
Share the games with younger children in the school. Those with access to the Just2easy Tool Suite may do that with blogging or sharing, other schools may use the "link" button.
Follow up lesson(s)
Children should now have the skills to use J2Code and should be encouraged to design and create their own programs.
Children can be encouraged to continue to experiment by accessing J2Code at home.
Schools with access to the Just2easy ToolSuite may choose to blog some work, pupils can then leave comments on each other's work suggesting improvements or leaving feedback. Teachers may also save and share their own examples and templates.
Self and peer assessment - pupils can work with a partner to review, and help correct their code (debug).
- To use variables in the context of a game.
- To analyse and explain how an existing program works.
All children: will change how a a variable works in the planet game
Most children: will use a new variable in the planet game.
Some children: will create their own game using multiple variables.
Cross curricular links
Maths: geometry - position and direction.
variable, broadcast (see glossary).