Bunner cleans up

Version 0.4

The main aim of this revision was to get a slightly more solid base on which to proceed. The data for levels and sprites is now stored in a json file, data.json. A level now has this structure:

"height": 1,
"objects": [{
    "type": "b",
    "x": 0,
    "y": 0
"terrain": "g",
"width": 1,
"win": {
    "turn": 1

height and width define the level’s grid. terrain defines a default type which applies to all tiles, unless overridden. The objects array contains .. objects. They represent all things in-game that we can interact with, other than terrain. Type ‘b’ is for ‘bunner’. win defines our win condition(s); in this case, having taken a turn.

I’ve also tweaked the display this time round: everything fits on one canvas, on a big grid, with the playfield for the current level centered. Gridlines can be toggled be pressing g and the space between tiles can be changed with m.