Why did the chicken cross the road? To get to the other side!

Frogger Arcade Game

Thats the idea in Frogger! Frogger was a popular arcade game from the 80s. It involves getting a frog across a busy series of roads and rivers, avoiding cars and using logs to avoid landing on crocodiles. It became popular again in 2014 due to the mobile app Crossy Roads which through a redesign and updated characters helped bring Frogger into the 21st Century. Now it’s your job to make it even more modern and build your own Frogger.

Test our version here – how can you improve on it?  https://scratch.mit.edu/projects/547870654/

Select Sprite

  • The original frogger focused on a frog, but your game can feature anyone as a protagonist
  • Come up with a story
    • Who are they?
    • Where are they coming from?
    • Where do they want to go?

Create Background

Scratch Background

  • Think about environments and obstacles
  • Where is your character?
  • What might your character encounter?
  • Keep it simple, you can always change it later
    • The background may need to be adjusted to make sure your sprite and obstacles line up

Add movement to your character

  • When the game starts set the direction to 0 and the position to X 0 and Y -160
    • This may need adjusted based on your background design
  • If Up Arrow pressed
    • Point in direction 0 and move 10 steps
  • If Left Arrow pressed
    • Point in direction -90 and move 10 steps
  • If Right Arrow pressed
    • Point in direction 90 and move 10 steps

Create Obstacle

  • Search or create your own sprite to serve as an obstacle
    • It’s helpful to find multiple you like, but we only need to place one for now
  • Select a starting position along the edge of the screen and set it to the X and Y values on start

Add movement to obstacles

Scratch Code snippet depicting how to move obstacles along the x axis

  • Set to point in direction 90
  • For some extra challenge lets set the movement to random
    • Between 1 and 10 has worked for me but feel free to test your own speeds
  • If X>230, send the obstacle to the start position and copy the direction and movement blocks
    • You may want to try different numbers to see where you like your obstacle disappearing at
  • One of the magical things about Scratch – you can duplicate the obstacle and change the costume and directions to save rewriting all the code
    • Select or design a new costume for your new sprite for some visual interest
    • Make sure to change the start positions of each obstacle
    • If you want an obstacle to move Right to Left change the random movement to a negative number and X<-230
    • You can duplicate your obstacle or drag the block of code onto other sprites to create multiple obstacles.

Set Collisions

  • Create a variable named “Alive?”
    • You can hide this variable by unticking it, players don’t need to see it

 

  • Click on your player sprite
  • When the game starts, set Alive? = 1
    • Think of it like lives in a game, in this case they have one life

 

  • Create a new If Statement “If touching Obstacle”
    • You’ll need to select your obstacle’s name from the dropdown
  • Set variable Alive? = 0
    • You’ll need to duplicate this code for each obstacle you have created and assign an obstacle

Crossing the river

  • Use the touching colour tool under Sensing to select the colour of the river
    • The idea is to create a log or similar the player can float on to avoid falling in the water
  • Select or design a sprite to serve as your flotation device
  • Adjust the speed to your liking by changing the move speed
    • how easy do you want the level to be for your player?
  • If the player is touching the river colour, but also a log we want them to move with the log
    • Make sure the move speed of the log and player are the same, you don’t want them to fall off
    • Copy the movement controls over so they can still move around and off the log
  • If the player is touching the river colour, and NOT touching a log
    • Set Alive? to 0

Game Over

  • Create a victory and defeat sprites
    • Think about the games you play, how do you know if you’ve won or lost?
  • Hide your new sprites
  • If alive = 0 this means the character has died and the code should stop
    • You’ll need to put this condition at the end of each Obstacles code
  • Select your Defeat sprite, if Alive = 0 show
  • If the characters Y value = the top of the screen (180), this means they’ve successfully crossed the level and won
  • When you win you want to shout about it, so let’s broadcast a message across your code yelling “Victory!”
  • When the victory sprite hears this message, set it to show

Switch costume for more random

  • Create a Variable named “RandomObstacle”
    • You can hide this variable by unticking it, players don’t need to see it
  • Find multiple costumes for your character to have to avoid
    • 3 – 5 seems a reasonable number
  • Set RandomObstacle to Random and then 1 to however many costumes you have
  • For each number create an If statement and assign a costume
  • Hit the green flag and check your costume changes
    • Some costumes may require re-scaling which can be done with the size block under looks
    • It may repeat the same costume a few times in a row, thats okay!

Testing

  • Now that you’ve done all the hard work its time to test your game
  • Play through it yourself
    • Does it work as intended? Is there anything that doesn’t line up and needs adjusting
    • Do you see any changes you’d like to make?
  • Now find a friend and have them test it
    • Lets use two stars and a wish to talk about what we like in each others games and one thing we think could be made even better
    • Criticism is best when its constructive, help each other become even better developers

Congratulations! You’ve built a game! If you can build frogger from scratch, whats stopping you building the next Minecraft!