Posts

Showing posts from February, 2020

Metroidvania Month 7 Day 9

Yeah, I missed a day.  Hopefully, I can still get Daemon in a working state on time. I was looking into possible control schemes for the game and managed to find some documentation on Gamepads for HTML5 .  It seems like it is just like adding the Gamepad's "keyup" Events to the window, but you have its connect/disconnect Events as well.  I think it would be nice to have a Gamepad and have the game play like Super Metroid.  However, I don't think all the controllers are the same: a button on an Xbox controller plugged into the PC might use a different Event than the same button on a PS4.  They might confirm to the standard Gamepad setup , but I don't want to add any extra complications at this time.  So, I'm just going to focus on WASD and Arrow Keys on the Keyboard for now.  Maybe add a touchscreen control pad for smartphones later.  I'm just trying to get stuff to a working state first, then I'll add those extra features in the future. My fir...

Metroidvania Month 7 Day 7

I managed to get some code started today.  It's mostly just copying Bee Flat and taking out all the Bee and Arcade related items.  So, I want to say thank you to Jedulz for all the work he did helping me with Bee Flat that I'm placing into Daemon. Once I had most of Bee Flat copied and cut to it's bare bones, I started creating the SaveFile class.  I decided to go with 1D Arrays for storing ability pickups, tanks, and missiles.  There is a 2D Array for the Test Area that I'll used to test out my "Room Load" idea.  To make it easier to create new Cells in that 2D Array, I made the generateGrid(gridRows, gridColumns) function in the file with the SaveFile Class.  That function allows me to just specify the number of Rows and Columns for the Grid, and it will then create a Grid of that size with each Cell containing an Object with visited = false and foundItem = false.  Meaning, every Cell is marked as not visited.  I did use some w3Schools artic...

Metroidvania Month 7 Day 6

Hey, I know it might say "Published 2/21/2020" so it should be Day 7 instead, but I was thinking about an idea I had for the save files just now and I wanted to type them up before going to bed. The question rattling around in my head was this:  how do I save the exact power-up that I've collected?  Simple: we store an ID in an Array.  The save file will be a JSON object and within that we could have arrays for each max ammo and max health power-up type.  Say in the game we have Tanks that store extra health.  In our SaveFile JSON object, we would have an Array called "tanks" that just stores IDs of collected Tanks.  When we enter a room that has a Tank, we search SaveFile.tanks array for the ID of that Tank.  If the ID is found, don't spawn that Tank, otherwise, we spawn it if it hasn't been collected.  What is the maximum collected Tanks that we should fill?  SaveFile.tanks.length should give us the maximum Tanks to fill. After answerin...

Metroidvania Month 7 Day 4

Image
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 ...

Metroidvania Month 7 Day 3

Image
Don't worry, there's no Metroidvania Month 7 Day 1 or 2.  It would have just been me telling you that I'm still working on a title.  I wish I could just start creating something, but GitHub wants me to name my repositories first before starting on my project.  I guess I could have created the files on my computer, but I hate the idea that my work could be lost without backups or commits that I can roll back in case I mess something up.  I could have also given this game a "Project Name", but I feel like I might accidentally create one that is better than the end product (see Project Scorpio and Project Revolution for example). Anyway, I came up with thirteen names for the game and ended up settling on Daemon . The game is about a robot that has gained sentience in a lab and now has to collect power-ups to help it escape.  Daemon, in computing , means a computer program that runs as a background process.  I felt the name could be fitting as the robot ...