Devlog 6
It’s been a while but Ive made significant progress. Well not visually but Ill get to that in a second.
Ive added a fully functional map using leaflet, a javascript library for making easy maps. Im going to be using this map to toggle things like collected fleas, mask shards, spool fragments, etc.
Now, the main thing I worked on was a complete refactor of the code.
In the third devlog i said this
In the end I just settled for a big function with a lot of ifs to check with value to set. I know that its not the best way but its good enough for now.
And not the best way it was. I now realized that it was heavily slowing down how fast I was able to progress and the code was a big mess. Hundreds of if statements everywhere and almost no order.
So what did I do?
I created multiple massive lists that store all the data about a toggle-able thing.
{ key: "hasDash", type: "pd_bool", label: "Swift Step", img: "resources/abilities/swift_step.png" }
This is what one of these entries looks like.
The key is the thing in the save file that is to change.
The type is how its stored in the save file.
The label is the visual name the user sees.
The img is the image the user sees.
This way i can more easily add/remove entries and have way cleaner code because now I just need one central function to toggle a certain thing.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.