Flappy bird guide for Scratch

advertisement
Flappy bird guide for Scratch
Introduction
Flappy bird rose to popularity as an easy to play and addictive game at the
end of 2013
It is a game where the user must navigate the bird through a series of pipes.
It is stated that the creator (Dong Nguyen) made the game in 3 days, and has
made up to $50,000 a day from advertising in the game.
He is also sad that the game’s popularity has taken over his otherwise
“simple” life
Now it is your chance to see how easy it is to construct a game like this
Objectives
• Apply previous skills to put together basic blocks within Scratch to create an
app-style game
• Extend knowledge about variables and how you can affect the difficulty within
a game
Outcomes
• L5 – Get most of the basic game working without help. Most of the parts
about how the code is working have been filled out.
• L6 – Add the high scores table and fill out all the sections about how the code
is working accurately.
• L7 – Add other extensions to the game (see last slides for ideas)
• L8 - Complete the ‘ultimate extension’ (see last slide)
Sprites for Flappy Bird
If you are desperate to get the actual sprites (making your own is more fun!), I have
included them here and in the folder.
You can use the ‘import’ button to get them into your project from saved image files
Step 1 – Make your bird
1. Click on the ‘New sprite’ button
2. Create your bird, making sure
that the costume centre is in the
middle
3. On the costumes tab, copy the
first costume to make two
costumes, one with the wings up
and one with the wings down
Step 2 – Make the bird flap
1. We want to make the bird look
like it is flapping. Add the code to
the right to do this and test it.
How is the code above working? Explain below…
(Insert your ideas here)
Step 3 – Make the bird ‘fly’
1. On the variables tab, make a
variable called ‘Y’
2. Then you should be able to
construct the code as shown to the
right
3. Test your bird. Press the green
flag. You should be able to control it
with the space key
Explain how the bird code works
How is the code working? Explain below…
A
Part A
(Insert comments here)
B
Part B
(Insert comments here)
Part C
(Insert comments here)
Part D
(Insert comments here)
C
D
Step 4 – Edit the background
1. Open up the stage and edit the
background
2. The sky should be blue and there
should be a green layer of grass at
the bottom
Step 5 – Reset the game if the bird crashes
1. If the bird crashes into the
ground, then we want to reset the
game.
Add the code to the right into your
bird and test to see if it works
How is the code above working? Explain below…
(Insert your ideas here)
Step 7 – Make the pipes
1. You now need to make the
pipes that flappy must navigate
through
Create a new sprite, zoom out
fully and draw the pipes with a
gap in the middle.
Set the costume centre to
exactly in-between the pipes as
shown on the right
Step 8 – Code your pipes
1. For this part you will need to
create a new variable called ‘score’
2. Then, create the code as shown
on the right for the pipes
Then, test to see if this works
Explain how the pipe code works
How is the code working? Explain below…
Part A
(Insert comments here)
A
Part B
(Insert comments here)
B
Step 10 – Create and code the instructions
1. Make a new sprite for the
instructions
2. Use the text tool to create
something similar to the image on
the right
3. Add in the code for the
instructions to appear/disappear
when you want them to
How is the code working? Explain below…
(Insert your ideas here)
Step 11 – Adding the high scores logic
1. Make a new variable called
high_score
2. Find the code in the bird for
ending the game, and then add the
code for the high score in
How is the code above working? Explain below…
(Insert your ideas here)
Step 12 - Extensions
1. Can you make it so the variable ‘Y’ doesn’t show up on the screen?
2. Before the game starts, let the player decide the difficulty level. Adapt
difficulty by:
• Changing variables to do with bird/pipe movement
• Having different kinds/sizes of birds
3. Have items to collect and a points system for this too
4. Make the game two player
5. Have a shop system so that every time you play, your score gets added to
the total amount of coins, and then you can purchase costumes etc.
Step 13 – Ultimate extension
Balloon kid was a game on the Game boy and
was the sequel to ‘balloon fight’ on the NES.
Here is a video
http://www.youtube.com/watch?v=sBTBnFBip
B0
The difference between this game and flappy
bird are:
• The action is from right-to-left
• You can control the character’s position on
screen to help dodging things
• There are more objects than pipes
• The character has 3 lives (balloons)
These should keep you going for now. See if
you can adapt your game!
Download