0% found this document useful (0 votes)
148 views16 pages

Programming Games With Scratch: Teacher's Guide

This document provides an overview of a series of Scratch programming handouts that guide students through creating various computer games to teach programming concepts and computational thinking, with the handouts covering different types and difficulty levels of games and including sample programming solutions for reference.

Uploaded by

rugera wanjara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views16 pages

Programming Games With Scratch: Teacher's Guide

This document provides an overview of a series of Scratch programming handouts that guide students through creating various computer games to teach programming concepts and computational thinking, with the handouts covering different types and difficulty levels of games and including sample programming solutions for reference.

Uploaded by

rugera wanjara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Programming Games with Scratch

Teacher's Guide

Contents
About..................................................................................................................................................... 1
Suggested Activity ................................................................................................................................ 1
Additional Details ................................................................................................................................. 2
Handout Overview ................................................................................................................................ 3
Solutions................................................................................................................................................ 4
Driving Game .................................................................................................................................... 5
Super Fashion Dress-Up ................................................................................................................... 7
Clay Shooting .................................................................................................................................... 9
Room Escape....................................................................................................................................11
Cat and Mouse ................................................................................................................................ 12
Moon Landing ................................................................................................................................. 14

About
“Programming Games in Scratch” is a series of handouts that can be used to teach programming and
computational thinking. The handouts guide students through the logic and algorithms underlying
computer games. They cover many different types of games and different experience levels, so it is
easy to customize your lessons to the interests and abilities of different students. All the necessary
instructions are included on the handouts themselves, so students can often follow them without
guidance from a teacher. As such, teachers do not necessarily need a programming background to use
the handouts in classrooms; nevertheless, a programming background is useful for teachers to help
students contextualize the lessons, to help students when they encounter difficulties, and to direct
students to supplementary material for further learning.
The handouts make use of the Scratch programming language from MIT. Scratch is a free
programming language that can be used from most PCs without the need to install any software. It is
designed to expose programming to students in a friendly environment that encourages creativity and
independent learning.

Suggested Activity
The handouts contain all the necessary instructions to use them. As such, students can follow the
handouts themselves individually or in small groups. Younger students may need adult guidance to read
through the handouts and to stay focused on the tasks.

1
Unless students have experience using the Scratch language, they should all start with the introductory
handout “Making a Basic Game in Scratch.” They simply visit the website listed on the first page of the
handout and then following the instructions on the handout. The introductory handout provides an
overview of the basic functionality and features of the Scratch language by guiding students through
the making of a simple game. The handout is written in a “walkthrough”-style: all steps are described
in exact detail with no occasions for deviating from the suggested solution.

The other handouts are more open-ended and require more reflection by students to complete.
Instructions are described in general terms, requiring students to figure out the exact steps needed to
solve the problems themselves. Each handout is self-contained, so students can choose which handouts
to complete based on their interests and abilities. The handouts also often contain optional sections of
varied difficulties, which students can optionally complete based on their own interests and abilities.

Additional Details
Below is a list of the handouts:

Handout Difficulty Topics


Making a Basic Game in Scratch Introduction Introduction
Driving Easy Movement
Super Fashion Dress-Up Easy-Medium Costumes
Clay Shooting Easy-Medium Costumes, Random
Room Escape Medium Messages
Cat and Mouse Hard-Medium Collision Detection, Artificial Intelligence
Moon Landing Hard Variables

If students want to save their games, they can either


1. Choose “Download to your computer” from the “File” menu at the top of the website
2. After making some changes, sign in to Scratch, click on the orange “remix” button in the upper-
right of the screen, then choose “Save now” from the “File” menu.
Printable copies of the handouts and downloadable versions of the project files can be found at the
website http://o.ooli.ca/en/scratchgames
Do not be constrained by the handouts. Feel free to let students to choose a different direction. Help

2
foster an independent interest in programming. Encourage them to change the artwork, add their own
sounds, and to experiment with their own ideas. Have them add more enemies, write a story, or adjust
the speeds of things to change the difficulty level.

Handout Overview
Overall difficulty

When you start, go to this website


for the project files

If you aren’t familiar with this genre


of game, there is sometimes a
sample game you can try

If the instructions are unclear about


how the game is supposed to work,
play the finished game to find out

These are the blocks used in the


sample solution. Use this list as a
clue about how to solve each step. If
your solution is different though,
that’s ok. The important thing is
figuring out how to solve problems,
not getting the right answer.

Difficulty levels of each step are


listed at the side. These levels are
just guesses. They might be easier
or harder for different people.

Steps needed to make a basic game


are in white

Optional improvements to
the game are in grey

Although the handouts are in colour,


you can print them in black & white
without any problems.

3
Solutions

STOP

Although sample solutions are provided here, please avoid using them.
There are no “correct” or “perfect” solutions to the handouts. There are many ways to program the
same game. It is also possible (and even encouraged) for students to write their own variants of the
games that play differently and use completely different techniques.
The most important part of learning to program is to develop problem solving skills. Learners often
give up and want to see the “answers” too early. In programming, the “answers” are actually
unimportant. The important part of programming is struggling with problems and coming up with
solutions. Some programming problems have no solutions. Some require a lot of reflection and
ingenuity to find a solution. Some problems exceed a programmer’s skill level and require
programmers change their programs to behave in a way that’s easier to program.
The solutions are mainly provided to clarify some unclear descriptions in the handouts and to help
instructors provide hints to guide students.

4
2. No Shortcuts: When the up arrow key is
Driving Game pressed, the game should check whether the car is
1. Driving Part 1: Add a block for moving forward touching green (i.e. the grass) and move forward a
into the forever loop smaller amount if that is the case.

1. Driving Part 2: The blocks for turning right can


be repeated for turning left and moving forward.
In this case, they were put into a single forever
loop so that the game will continually check if the
keys are pressed forever. The old code for moving
forward is removed.

5
Try It: Speed and Brakes Part 1: It’s the same code Try It: Speed and Brakes Part 2: Then, we can start
as in step 2 except that a new speed variable is playing with adjusting the speed. The speed will
substituted in for the number of steps to move initially be set to 0. When the up arrow is pressed,
forward. That speed variable is initially set to 3. the car should go faster. That means the speed
should be increased. Do something similar when
the down arrow is pressed for slowing the car
down. Lastly, the car should always move
forward by the speed regardless of what keys are
being pressed.

6
Super Fashion Dress-Up 5. More than Just Pants: Although it's possible to
use a “when space key pressed” event block to
3. Moving the Pants: You should make the check when a key is pressed, it is recommended
“Clothes” sprite keep moving to the mouse that you use an “if ___ then” block instead.
pointer in a forever loop.
The clones of a sprite will respond to events just
like the original sprite. When a “when space key
pressed” event block is used, all the clothes added
to the doll will change when you press space
because they are clones. You don’t want that. By
using “if ___ then” blocks in a forever loop that is
started when the green flag is clicked, you avoid
this problem.
4. Adding the Pants to the Doll: In the “Clothes” The code for the “if ___ then” block is similar to
sprite, you should keep checking if the mouse the code from the previous section, except that it
button is pressed down, and create a clone of the will change the costume instead of creating a
sprite if the mouse button is down. You can create clone.
a new forever loop for this, or reuse the loop used
in the previous step. Since clones will be
continually created while the mouse button is held
down, you should wait a small amount of time
(0.2 seconds works well) after creating the clone
to prevent too many clones from being created.

7
6. Body Styles: In the “Body” sprite, you should 8. Hair Styles: The “switch costume to” block can
add code that is almost identical to the code you be used to switch to a costume # and not just a
wrote in the previous section. It's also possible to costume name. Since each hair style has five
use a “when ___ key pressed” event block, and it colours, you can change the hair style by skipping
is safe to do so since you are not making any over five costumes.
clones of the “Body” sprite, just the “Clothes”
sprite.

7. New Hair at the Press of a Key: The code for the


hair is the same as the code that you wrote for the
body.

Try It: Clothing Colours: When a key is pressed,


you can use the “change color effect by ___”
block to change the colour of a sprite.

8
Clay Shooting 4. Play Again: After the clay moves, it should
check if it’s touching the edge and then reset its
1. Move the Crosshair: On the crosshair sprite, position and costume if it is.
have it continuously move itself to where the
mouse pointer is.

2. Flying Clay: On the clay sprite, move it to the


starting position. Then have it just continually
move.

5. Different Directions: When hitting the edge, the


clay will not just reset its position and costume. It
will also choose a random direction to move in.

3. Shooting: Write your code on the Clay sprite.


Although it’s possible to use the “When sprite is
clicked” event block, younger kids often have
trouble with that block because the sprite has to
be clicked quickly for the event to trigger (Scratch
will think you’re trying to drag the block), and
they lack the coordination needed to do so.
Instead, it’s more reliable to continually check if
the mouse button is pressed down and the sprite is
touching the mouse pointer. Switch costumes as
appropriate.

9
6. No Cheating: Hide the clay when it touches the
edge. Wait a random amount. Show the sprite
again after the wait.

10
Room Escape Try It: Combination Lock: On every single number,
it should advance to the next number when it is
1-4. Books, Painting, Clock, Door: The code should clicked.
be put on the book, painting, clock, and door
respectively. The code is similar for all three.
When the sprite is clicked, they should ask for the
code, and then hide themselves if the right answer
is given.

Try It: Checking the Combination Part 1: On each


of the numbers, it should announce that it has
changed whenever its costume changes.

Try It: Checking the Combination Part 2: On the books, painting, clock, and door, there needs to be code
that is run whenever one of the numbers on the combinations are changed. It should then check if the
code is correct. Since the costume # is the same as the number being shown, it’s possible to just
compare the costume #s to see if they match the desired code.

11
Cat and Mouse 4. Caught!: The code below is put on the cat, but
similar code can be put on the mouse instead. In
1. The Mouse: Put this code on the mouse. It this case, the code is put in a new, separate
should only “point towards” the mouse-pointer forever loop, but it’s also possible to put the code
and then move forward. in forever loop that you already have.

2. Cheese: On the cheese sprite, continually check


if the mouse is touching it, and hide itself if that 5. Walls: This can be a little tricky because you
happens. have to be sure that if you touch a wall, you move
back to exactly where you started. Often, the logic
is a little off, and the mouse doesn’t move back all
the way. In that case, the mouse might end up still
touching the wall afterwards, leading to it getting
stuck or to other erratic behavior.
The easiest way to make sure that the behavior is
right, is that ANY time the mouse moves, you
should immediately check if it has a wall and
immediately move it back if it is.

3. The Cat: On the cat, just put in some blocks for


moving and bouncing off edges.

12
6. The Cat and Walls Part 1: The code for moving Try It: Less Jumpy: If the mouse is too close to the
the cat is similar to that of the mouse. mouse pointer, it will “overshoot” the mouse-
pointer when it moves towards it. To avoid this
problem, don’t move if the mouse is already close
to the mouse pointer.

6. The Cat and Walls Part 2: Here, it also turns


around when it hits the wall.

7. Walking the Maze: Instead of turning 180


degrees, the cat should turn a multiple of 90
degrees instead.

13
Moon Landing 2. Crashing: Add some code to the “forever” loop
that checks if the ground is hit or not.
1. Basic Movement: Just copy the code for moving
left and right in order to move up and down.

14
3. Space Movement: Instead of having the left and 4. Up and Down: Do a similar thing with the up
right arrow keys change the x position directly, and down arrow keys.
these keys will change the x speed. The x position
will be continuously changed by the x speed
regardless of whether the arrow keys are pressed
or not.

15
5. Moon Gravity: Gravity is simulated with just an 6. Landing: Since the previous code stack is
extra block that changes the y speed every turn. getting a little long, here the code for landing is
put in a separate stack, but it can also be merged
into the existing forever loop.

16

You might also like