Wouldn’t it be more fun if we were dealing with Pokemon instead of an Ogre?

Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image Background Image

These are the image dimensions for the pokemon.

var pokemon_dimensions = new Array(
	new Array(27, 32),
	new Array(27, 32),
	new Array(29, 32),
	new Array(27, 32),
	new Array(21, 32),
	new Array(32, 24),
	new Array(31, 32),
	new Array(32, 30),
	new Array(30, 32),
	new Array(27, 32),
	new Array(26, 32),
	new Array(28, 32),
	new Array(30, 32),
	new Array(32, 24),
	new Array(32, 30),
	new Array(24, 32),
	new Array(32, 26),
	new Array(18, 32)
);

Add this to your spawnMonster function.

pokemon = Math.floor(Math.random() * 18) + 1;
monsterImage.src = "images/pokemon/"+pokemon+".png";
monster.width = pokemon_dimensions[pokemon - 1][0];
monster.height = pokemon_dimensions[pokemon - 1][1];

Let’s rename some methods. monstersSlain should be pokemonCaught. slayMonster should be catchPokemon.

You can download this example.