Lesson 6 V3
Lesson 6 V3
Lesson 6 V3
Mini Game
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).
Sensing Blocks
Sensing gives us a true or false response. We can then create scripts which do different things if
the answer is true or false.
• Write some code to make both sprites move around the screen.
• Click on the Good Guy script.
• Add the following blocks to your code.
This block give you space to put in a condition.
• These scripts will give us a true or false response i.e. Good Guy is touching Bad Guy
(True) or it is not touching (False).
• Now we can decide what will happen when the sprites touch. You can insert sound or
oks
Challenge Time 1!
1. Choose two sprites and name them.
2. Add movement to each sprite.
3. Input the code from the image above to
one sprite.
4. Alter the code to create your own
effects.
Variables
Using the game we just created we will add lives to our Good Guy. We will start with 5 lives. Each
time the Bad guy touches the good guy he will lose a life.
• Click on the Good Guy sprite.
• Click on the variables palette.
• Click Make a variable.
• Call it “Lives”. This will appear on the stage.
• You will now see additional options in the
variables palette.
• Drag out “set lives to” and type 5 into the box.
• Add this to the start of your script.
Lesson 6 | 3
• Within the “if loop” we will change the • You will note that the lives will decrease
lives by minus one each time the Bad Guy by one each time. However, we need the
touches the Good Guy. game to end when the Good Guy has 0 lives
left. This will require another “if” statement,
Challenge Time 2!
1. Choose a sprite and name him Good Guy. If you wish to use your own names do!
2. Use the up, down, left and right arrows to move the sprite (recall Lesson 1).
3. Select another sprite and name him Bad Guy. Allow him to move randomly around the
screen when the green flag is pressed. (as for sprites in examples above).
4. Give the first sprite 5 lives.
5. Every time Bad Guy touches Good Guy, Good Guy should lose a life.
6. Allow your classmates to play your game. See who can keep their lives the longest!
Ultimate Challenge!
1. Plan a game on paper. It could be a chasing game as above, a maze or a football
game or your own idea.
2. Create the game, using movement, sound, sensing and lives.
3. In the project notes (File, Project notes) write the instructions for your game.
4. Have a look at other people’s games. Tell them what you like and suggest ideas to
make their game even better!