I had been looking at some alternative programming languages, like Sonic Pi Processing and Scratch when I remembered a little game I created way back in 2008 and when one of my children was interested in writing computer games.
Playing around with Scratch and feeling particularly unoriginal, I decided to write a version of the game using Scratch. It turned out to be easier than I thought.
A very simple game (updated to add more non-kittens). Your job is to find kitten. This task is complicated by the existence of various things which are not kitten. Robot must touch items to determine if they are kitten or not. Use the arrow keys to move robot. The game ends when robotfindskitten. Inspired by the game of the same name by Leonard Richardson. Robots, Kittens etc. courtesy of iconarchive.com No robots or kittens were harmed in the making of this game.
Because it was targetted at younger players (my son was 10 at the time), I went with a very vivid, retro feel for the icons and colours. Read on, if you have sunglasses to hand :)
Setting the Stage
The background and “host” for a scratch game is called “the stage”. A stage can have a background, display text, react to events and host other game stuff, icons, avatars etc.
The game starts off with some simple instructions:
Clicking on the game (stage), the starts the game with a screen filled with hidden, potential-kittens, disguised as packages, and a robot that you move around to interact with the packages to see what they are.
Once the kitten has been found by the robot, the complete screen is shown:
The number of avatars is fixed but each’s location is randomised at startup to make the game harder. Kittens and Non-Kittens have the same starting avatar (package) but change to reveal their “real” identity when bumped into by Robot. The game is over when Robot finds the Kitten.
You can still see the game online at the scratch website.
Scratch stores each project as a single binary file, bundling all the “code” and graphics,
sound etc. together into a single image. The “source” below is therefore a set of screenshots of the project showing each of the actions performed by each sprite.
The best way to understand the code, such as it is, is to play with it in the Scratch environment.
If the game disappears from the MIT website, can get the scratch binary image of the game here