Animal Keeper
Last updated on September 23, 2011, 23:19 by Sebastian Mihai

I had wanted to code something in HTML5's Canvas for a while, and of course, I decided to make a little game.

Rules


You control a keeper who is trying his hardest to maintain the well-being of his animals. He can perform the following tasks:

move - click on any space on the playing field
pick up items such as food and medicine - click on the corresponding icon. The keeper will walk to it and pick it up. He can only hold one item.
feed animal/administer medicine - click inside of an animal enclosure. The keeper will automatically feed the animals in that enclosure, or administer the medicine, depending on what is being held at the time.

Note: when standing close to an animal enclosure, you can inspect the diet of the respective animal, in order to learn what to feed them.
Note: some foods are harmful to certain animals!

The game doesn't keep score. It's more like a simulation in that sense, but I think it is still fun to try to keep your animals happy. They will get sick and hungry quite fast. Be on your toes!

Click here to start

Notes


The game is based on the Canvas element in HTML5. I've made a few attempts to add sound as well, but had very poor results, and which varied wildly between browsers.

Since at every refresh (such as movement) the images have to be re-loaded (via setting the src attribute), I've converted the contents of my .png files to base64 and stored them as strings in Javascript. This means that the browser doesn't have to make a trip to the server to get them every time something moves on screen! The only image that is present is the playarea background, a large blended terrain texture.

You can download all game files locally (the directory can be accessed freely, listed, etc.), and tweak the code as you see fit. In particular, game balance constants are found at the beginning of globals.js.

Compatibility


The game works with Firefox 3, Firefox 4, and Internet Explorer 9 (click 'Allow blocked content').
The game does not work with Ice Weasel 3.
Compatibility with other browsers is unknown.

If you use the materials on this page, or any other page on this web site, you do so at your own risk. They are provided "as is". No warranty is provided or implied. I neither guarantee that the materials will work, nor that they will not be harmful in any way.

RGB Overdose (my entry at the GMD game programming competition)

Gameboy development - Burly Bear vs. The Mean Foxes

Project One - An action RPG engine

Neo Geo development - Neo Thunder

Sega Genesis development - Gen Poker

Airplane Vegas slot machine

Animal Keeper

Gameboy Advance development - smgbalib library

Gameboy Advance development - Balanced Diet

Super Nintendo development - Bucket

Atari 2600 development - Snappy (batari basic)

Nintendo NES development - Invaders must die!

Atari Lynx development - Catkanoid

TurboGrafx-16/PC Engine development - Alddee

Colecovision development - Mowleco

Sega Master System development - Burgers of Hanoi

Gameboy Color development - Burly Bear vs. The Mean Foxes (GBC version)

Nintendo Virtual Boy development - Real Danger

Vectrex development - Scalar Ownage

ZX Spectrum development - simple input/graphics example

Atari 5200 development - Shooting Gallery

Neo Geo Pocket Color development - NGCollector

My homebrew cartridges

Mowleco (ColecoVision) featured in Retro Gamer issue 106

BlackBerry PlayBook development - Sheepish Bearings (Native SDK, OpenGL)

Capacitor study circuit

Catch That LED! - an electronic game circuit

555 timer and 4017 decade counter - traffic lights circuit

A simple Atari 2600 joystick tester circuit

Seven segment display circuit with the 4511 decoder and the 4029 counter

Video compilation of my classic console homebrew games