Create Computer Games with Scratch - page 6

<<<
<<<
28
Now it’s time to make the final tweaks to our Dragons game. What if,
when you play the game, you get surrounded by dragons? It would be
nice to have a way out, wouldn’t it? Open dragons.sb2.
The Finishing
touches
Escape!
Let’s teleport! The teleport code looks like this:
When the T key is pressed, a new random cell
is generated and the frog is sent there. For fun,
we have made the frog glide to the spot while a
sound plays! Then the game continues just like
after any normal move.
We have also added rounds. Each time the frog beats all
the dragons, a new round starts. Each round has more
dragons, so the game gets harder and harder. We have
added two new variables—”Round” and “Score.” When
the green flag is clicked, we set these to 0 and call the
subroutine “NewRound.”
1,2,3,4,5 7,8,9,10
Powered by FlippingBook