Lesson 8 V3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Lesson Plan 8

Game Over!

Mathematical Skills / Concepts


Scratch Features
Curricular Links
Problem Solving, Variables, Sequencing
Variables, Sensing, Broadcasting
Mathematics, Art, Language

These lesson plans are available for free download for personal and educational use thanks to a generous grant by ICS Skills. It is distributed under
a Creative Commons Attribution-Non Commercial-NoDerivs licence, which means that you are free to copy, distribute, and display the lesson
plans provided you make no changes to the content (including the attribution to the authors and these license terms); you may not use these lesson
plans for commercial purposes, and you may not alter, transform, or build upon this work. We encourage the use of this material in educational
settings, and you are welcome to print your own copy of the lesson plans. We welcome enquiries and suggestions, which should be directed to the
authors (see www.lero.ie/educationoutreach).

© 2019 Lero MMXIX:VI:VIII Version 3.01


Learning Objectives
The child will:

• Create a game which uses variables to calculate lives and score.


• Use sensing to effect change in a game.
Teacher Tip
Introduction If children use other people’s
code, from scratch.mit.edu or
other sources, ensure that they
• View some of the sample games in Scratch. reference it in the project notes.
• Open Scratch. Click on File, Open, Examples, Games.
• Have a discussion with the children about the different games
they enjoy playing. Look at the code in the sample games and chat about how this code
could be altered to make other games.

Broadcasting
You may have noticed in the last lesson that if you lose all 5 lives in the game nothing happens.
Similarly if you get to the end of the maze, nothing happens. We will use broadcasting to create
suitable endings for the game, if you win or if you lose.

• Use your previous maze scripts (from lesson 7).


• If lives equal 0, we want the background to change to show that the game is over.
• If you get to the end by touching the green colour at the end of the maze background,
we want a background that tells you that you have won the game.
• Click on the stage, then backgrounds. Create 2 more backgrounds. One should say
Game Over. The other should say You Win. Change the language to suit your own game.

Create new back-


drops.

2 | Scratch Lesson Plan


• This code will require 2 “if” statements.

1. If all the lives are gone i.e. lives=0

• Click on the sprite.

• Click on scripts.

• Insert an “if” block.

• Use the operators palette


to create “if lives = 0”.

• From the control palette


select braodcast. Make a
new broadcast called “Game
Over”.

2. If the sprites get to the end of the


maze successfully by touching the
colour.
• Add another “if” block to
the sequence.

• Use the sensing palette


select the “touching color”
block and place it in the “if”
block.

• From the control palette


select braodcast. Make a new
broadcast called “You Win”.

Lesson 8 | 3
• When we send out a broadcast, it sends a message to another part of the program.
We need to create a program to receive this message and to act upon it.
• Click on the stage.
• Now we need three different pieces of code.
1. To show the Maze background when we start the game.
2. To show the Game Over background if we lose.
3. To show the You Win background if we get to the end of the maze.
• Click on the stage.
• Click on scripts.

Challenge Time 1!
1. Create a maze background.
2. Choose a sprite.
3. Use if statements and broadcasts to create a maze game.
4. Add Lives to your game. What happens if you lose all your lives?
What happens if you win the game? Add sounds e.g. cheering when you win.
5. Use a broadcast called “Level 2” to extend your game. You may need more
backgrounds for this.
6. Allow your classmates to play your game. See who plays the best!

4 | Scratch Lesson Plan


Ultimate Challenge!
1. Plan a game which uses Lives or another variable e.g. Score.
2. Choose sprites and backgrounds for your game.
3. Use if statements and broadcasts to create your game.
4. Play your game to check for bugs. Try to solve all problems. Work with your
classmates.
5. Look at other people’s games. Tell them what you like and suggest ideas to make
their games even better!

Notes

You might also like