Recently I shared some Javascript code for generating a grid. I had been thinking that this code could also be used to create a top-down perspective adventure game, so I did some experiments with that. At the moment, I have a very, very basic framework set up that can’t really be called a game yet. But I thought it might be worth sharing.
topdown-game-test.html (2.1 MB)
At the moment, the only things you can do are move the wolf around with the arrow keys and complete the one quest to pick up the mysterious object by moving over it. There are a ton of other things I’d theoretically like to add. But for now, I just focused on establishing a few things:
- You should not be able to move across certain tiles, for example, if the tile contains a rock or water. These are “wall” tiles that the player must go around.
- The “mysterious object” should spawn on a random tile, but it must be a tile that the player can walk on (so, not a “wall” tile).
- The player shouldn’t be able to go out of bounds of the map.
More to come in the future…probably.