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 articles on Arrays, For-Loops, and Classes just to make sure I was writing that function correctly.
I gave the output of my SaveFile constructor a simple test: "let save = new SaveFile();" from the Developer Console on Chrome. The 1D Arrays and the Save Room numbers work just fine. However, my 2D Array for the explored Test Area wrapped each Cell in its own array. I have to use save.testArea[gridRow, gridColumn][0] to get at the Object for that Cell in Test Area. I was going back and forth between creating a CellTracker class to set up the visited and itemFound variables for each Cell of the Grid. Maybe I could use that to fix this weird issue, but I'll have to wait for tomorrow. It's getting late.
You can check out the repository for Daemon, here. I have the Github.io page for Daemon live, but nothing is playable yet.
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 articles on Arrays, For-Loops, and Classes just to make sure I was writing that function correctly.
I gave the output of my SaveFile constructor a simple test: "let save = new SaveFile();" from the Developer Console on Chrome. The 1D Arrays and the Save Room numbers work just fine. However, my 2D Array for the explored Test Area wrapped each Cell in its own array. I have to use save.testArea[gridRow, gridColumn][0] to get at the Object for that Cell in Test Area. I was going back and forth between creating a CellTracker class to set up the visited and itemFound variables for each Cell of the Grid. Maybe I could use that to fix this weird issue, but I'll have to wait for tomorrow. It's getting late.
You can check out the repository for Daemon, here. I have the Github.io page for Daemon live, but nothing is playable yet.
Comments
Post a Comment