In the wise words of Ash Williams from Army of Darkness: “Oh nooo! I’ve slept too much!”
But having your batteries charged makes a big difference. I can already think clearer than before. Here’s a simple screenshot:
What I’ve got so far:
- Moving between rooms engine.
- Crappy collision detection (improving that now)
- Layers! You can walk behind stuff!
- Walking and running, with animation. Looks pretty good in game. Running animation is just a sped-up walking animation right now.
- The character also blinks. Not a huge thing, but these details are the things that bring life to characters.
Now to fix the collision and make locked doors and interactive objects.
Since I don’t have a lot of time to code anything complex, everything is being hardcoded and precomputed. Here’s what the collision map looks like:
Green is ground. If a color has red=255, it means it’s a doorway or a “transitional object”. Run into it, and the game will pick up the blue component of the color as an ID.
This ID is used to load another room with a fade-out fade-in transition. Simple stuff.
The ID is not unique for the game, but for the room. This means that, in a single room, I can have “doorways” to up to 256 other rooms. Ain’t that cute?
(Currently, I’m just loading the same room over and over. It’s actually quite creepy. I think I’m gonna use this!)
When I change a rooms, I have a state object that gives me the previous room name. I can use this to place the character in the proper location in the new room, as well as run state-specific events later.
All right, enough talking. Must write more code!