I made this game for the Ludum Dare 46, where the theme was Keep it alive. I kind of disregarded the theme completely because I had already decided I wanted to further develop the NES-style map editor and framework that was used in Tasty Camping. The game is inspired by the Lode Runner games, especially the Macintosh version which I played endlessly as a kid. The best part of that game was the level editor.
My little editor could already handle tilemaps, animated sprites and character movement. To make a platformed I needed to add collision detection and states for falling down and climbing the ladders. I made the states using a state stack, so that every state could either keep updating, stop updating or create a new state on the stack, which would then be updated. This proved very handy, because the states had very little connections between them and none of them had to worry about which state to return to.
For example when the player character would walk, then climb a ladder and then move sideways when on the ladder and fall back down, the state stack would work like this. The active state is the rightmost one.
> Walk
> Walk > Push climb state
> Walk > Climb
> Walk > Pop climb state
> Walk > Detect that there is no floor under character
> Walk > Push fall state
> Walk > Fall
> Walk > Detect floor under character: Pop fall state
> Walk
I tried to apply the same idea to game states as well, but because Lua always returns a reference instead of copy I just hacked around it, but in theory it would work too.
I asked around if anyone was interested in programming, music or graphics and my friend Aviul agreed to do the animations for the player and the chests. They also created some stalagmites and waterfall tiles. Rest of the graphics were taken from Open Game Art.
The game itself is very simple. Go to the cave and collect all gold. When everything is collected the game simply ends. I did not have time to make any music or sounds, but I am happy that I managed to get the player state stack working, although it could be better :)
You can download the game for Windows from my google drive.
No comments:
Post a Comment