Monday 11 February 2013

Second Scratch Game - Whack-a-Bird

The second Scratch game I wrote, and the first I "shared" on the Scratch website, was called "Whack-a-Bird".

I've always liked whack-a-mole games (both the real and the computer versions) and I thought it would be a nice one to do with sprites (controlling position, appearance and detecting clicks).

I decided quite early on that the "mole" should be one of the red angry birds. Then one of my kids reminded me that there should be some targets that you should not want to hit and the black (exploding) angry bird was the obvious candidate.

I used to play a game called "Boulder Dash" back in the 80's and the main character ("Rockford") used to tap his foot if you didn't get on with the game. This made me think that I should animate the splash screen in some way so I put on of the birds onto it and I had him look from left to right continuously. Then I was wondering where to put the instructions so I had him "say" them randomly while waiting for the game to start.

In my version you have 2 minutes for the game, things speed up as time runs down, and then game ends if you miss 10 birds. You can play it here.

Once I had "finished" the game, I decided that an important element was missing - the possibility to have multiple birds popping up at the same time. The obvious solution to this is to have 9 sprites - one per hole. This would be the right solution if you could "clone" sprites during the game but (since you can't in the current version of Scratch) you would need to duplicate the sprite in the designer. I though this was a bit of a cop-out. In the end I created 4 copies of the sprite and I position them randomly into the 9 positions. This version of the game is much harder/more challenging. You can play it here.