Metroidvania Month 7 Day 4
One of the things I feel is necessary in a game that isn't a small Arcade Title is the ability to save and load my game. If you have a story in your game, you need to be able to save your progress and return to it later to experience the whole thing. So, I went searching. I found a question on Stackoverflow and an answer that explained the difference between internet cookies and localStorage. After some more research, I chose to go with this localStorage. It's new to HTML5 and is available on nearly every browser. Plus, I found some really great examples on w3schools for Web Storage. The Metroid games have three save "slots"; so I think I can create a JSON for the save "slot", turn it into a string, and then set the localStorage "slot" for it. Then, when I need to load the game, I just get that localStorage "slot", transform it back into a JSON, and then use it to set the game back to a state before the player left. We'll see once I start coding the actual thing.
I've also been thinking about different Room shapes: what if I wanted something that wasn't a quadrilateral or a square? That's where I came up with the idea of camBlockers! Let me explain with a picture:
Here, Room b has this weird, rotated, S shape to it. It doesn't confirm to a quadrilateral, so how do I create this Room? Well, I start by making a big quadrilateral space that is 4 by 3 Grid-Cells for the Room Boundary. Then I fill the room with six camBlockers to give it that shape (the red striped squares in the above picture). I call them camBlockers because they will block the green camera square. I figured I could create an object in the game that acts like the camera. That way I can make sure the camera keeps the player character (the blue dot in the picture) centered on the screen unless that would violate two laws: a camera must not go outside the Room Boundaries, and a camera must not enter a zone blocked by a camBlocker. The player character cannot go inside a zone blocked by a camBlocker, either. If they did, it would not fit with the layout displayed on the map.
When I made the camera an object in the game, I came up with ideas of it being used to mark cells visited on our map, trigger spawn points, and to trigger cut scenes. If the camera's position is the top left corner of an explore-able cell, mark it as explored on the map. We can have enemies spawn when you enter a room or be like Ninja Gaiden and have the enemy spawn every time the camera hits the spawn point. Maybe I should just have it spawn an enemy once and then remove the spawn point. I've never encountered an infinitely spawning enemy that worked like that in Metroid.
Well, I didn't get any actual coding work done on the game, but I do love planning this stuff out. Here's the link to the repository for Daemon anyway.
I've also been thinking about different Room shapes: what if I wanted something that wasn't a quadrilateral or a square? That's where I came up with the idea of camBlockers! Let me explain with a picture:
Here, Room b has this weird, rotated, S shape to it. It doesn't confirm to a quadrilateral, so how do I create this Room? Well, I start by making a big quadrilateral space that is 4 by 3 Grid-Cells for the Room Boundary. Then I fill the room with six camBlockers to give it that shape (the red striped squares in the above picture). I call them camBlockers because they will block the green camera square. I figured I could create an object in the game that acts like the camera. That way I can make sure the camera keeps the player character (the blue dot in the picture) centered on the screen unless that would violate two laws: a camera must not go outside the Room Boundaries, and a camera must not enter a zone blocked by a camBlocker. The player character cannot go inside a zone blocked by a camBlocker, either. If they did, it would not fit with the layout displayed on the map.
When I made the camera an object in the game, I came up with ideas of it being used to mark cells visited on our map, trigger spawn points, and to trigger cut scenes. If the camera's position is the top left corner of an explore-able cell, mark it as explored on the map. We can have enemies spawn when you enter a room or be like Ninja Gaiden and have the enemy spawn every time the camera hits the spawn point. Maybe I should just have it spawn an enemy once and then remove the spawn point. I've never encountered an infinitely spawning enemy that worked like that in Metroid.
Well, I didn't get any actual coding work done on the game, but I do love planning this stuff out. Here's the link to the repository for Daemon anyway.
Comments
Post a Comment