Professional Documents
Culture Documents
Harry Potter Scratch Game
Harry Potter Scratch Game
Game
Pranali Choubal
Kunal Shah
Barb Ericson
ericson@cc.gatech.edu
Dec 2007
The Game
Use the arrow keys
to move Harry
Potter
to catch the golden
snitch
to avoid being hit
by the bludger
Getting Started
Start Scratch
Delete the cat
Click on scissors
and then the cat
or right click on the
cat and pick delete
change x by 1
click on 1 and change to -4
10
240
x decreases
x increases
-180
Harry Potter Scratch Gam
e
11
When up arrow
change y by 4
12
13
14
Snitch Behavior
In a 'normal' Quidditch game the game is
over when the snitch is caught
But, in this game you will have to catch 10
snitches to win.
you will need to keep track of the number
caught
15
Variables
To remember how many
snitches were caught we
will need a variable
16
Starting
Scratch games and
animations usually start
when you click the green
flag
Click on Stage to select it
Click on Scripts to program
Click on Control to see the
control blocks
Drag the "when green flag
clicked" block out
Click on Variables
drag the "set Snitches
Caught to 0"
17
Messages
Scripts can receive messages
and broadcast messages
blocks are in the Control
area
18
19
Responding to Caught
from Number
Play a sound
20
Conditional Execution
Sometimes we want to execute a block or
several blocks if some condition is true
use sensing blocks or number blocks that
return true or false
these have 6 sides (hexagon)
21
from Control
from Sensing
22
23
More on Conditionals
Sometimes we want to execute some
blocks if a condition is true and other
blocks if it is false
Use a if and else block from Control
for this
24
25
drag in "Snitches
Caught" to the first
blank area
from Variables
26
27
Stage Scripts
Click on Stage and Scripts
Set the initial background
to the stadium
when the green flag is
clicked
from Looks
28
29
30
Making it Harder
add a Bludger
if the Bludger hits
Harry he "dies"
start with 3 lives
lose a life each time
Harry dies
31
32
33
Painting a Bludger
You can paint a new
sprite
34
Loops
Sometimes you want to repeat blocks until
the game ends or something happens
Use a forever block to repeat actions until
the game ends
use a stop all block to stop all scripts
35
Bludger Scripts
When the green flag
is clicked loop
forever
set x to 260
hide the bludger
wait for some
random amount of
time between 3 and
5 seconds
show the bludger
Glide to the
opposite side
x is -260
random y from
-145 to 145
36
Bludger Scripts
When the green flag
is clicked, loop forever
check if touching Harry
play a sound
reduce the number of
lives
check if lost
lives = 0
37
38
from Control
39
40
Project Notes
Click on the notepad in
the top right corner
Type in project notes
You can upload your
project to the
Scratch web site
Click on Share!
See it at
http://scratch.mit.edu
41
Extensions
42