Castle Defense

Saved games stay in this browser only.

About the game

Castle Defense turns arithmetic into a defence game. A castle hall, drawn in the warm isometric pixel art of the Liberated Pixel Cup, has archers standing guard on the left, and each of them has a number in front of him and a small operation printed under it: 6 + 3, 8 + 3, and so on. Skeletons come in through the door at the top and march along the winding path towards the exit. To shoot, you work out the result for one of the archers and type it on the number keys: the archer whose sum you solved looses an arrow across the hall, and a new number appears in front of him.

A wrong answer costs you points, so it pays to be sure before you type.

You start with three lives, and every skeleton that gets past costs you one. There are nine levels, and the sums change as you go: first additions, then subtractions, then multiplications, and later bigger numbers with more skeletons walking in groups. Finishing a level gives you a speed bonus and an extra life, so a quick answer pays twice. Your best score is remembered in this browser.

It is a short, honest idea done well: the typing is satisfying, the pace picks up without warning, and there is nothing to configure. It is also a good one to play with a child who is learning the tables.

Playing it here

Click Play, then click once inside the game so that it gets the keyboard. The title screen waits for Enter. The game needs a keyboard with number keys (the numeric pad works too), so it is meant for a computer. Nothing is loaded from other sites.

Controls

Key Action
0 to 9 (or the numeric pad) type the answer
Backspace erase the last digit
Enter start the game, continue to the next level, restart after a game over
M music on or off

Tips

Solve whichever sum is quicker. All the sums are on the screen at the same time, so you can answer the one that is easiest for you.

Type the whole number. Answers with two digits need both digits; if you make a mistake, Backspace erases it.

Keep your lives. A skeleton that reaches the exit costs a life, and a finished level gives one back.

Frequently asked questions

Does it save my progress? It remembers your best score in this browser. A run itself is not saved.

Does it work on a phone? No: it needs the number keys of a keyboard.

Is it free? Yes: the code is GPL and the art and music are CC BY-SA.

Credits and licence

Castle Defense was written by Bryant Brownell for the Liberated Pixel Cup 2012. The tiles are by Guido Bos, the character sprites and the icon by Johannes Sjolund, the music ("Torvald") by Nelson James Gatlin, and the four sound effects by Johnathan Roatch. The code is released under the GNU GPL 3 or later, and the art and music under the Creative Commons Attribution-ShareAlike 3.0 licence (also under the GPL 3 or later). The version served here is the one the author sent to OpenGameArt, with one change: the keys it keeps in the browser storage have a prefix, so they do not mix with other games. The complete source, our change and the licence texts are linked from the Licenses page.