Hi everyone, this is the first time I post something in the forums and I'm very new to GML (but not to programming). I have a few questions about persistence and what would be the best approach.
I'm making a metroidvania (I know it's not the best idea for a first game) and my first idea was to make a master persistent object from the first room to handle some "global" variables, but the player object still had it's own variables (hp, max_hp, status, etc.), this became a problem when I implemented transition between rooms and I created a new player object in the new room.
I've heard about ds_maps but still haven't played with them, my next idea is to make the master object to hold the player variables, but I wanted to know what would be the best way to handle this, maybe a ds_map in the master object with the player variables, but the player still having the same variables, just copying them to the player object every time it is created in a new room and copying them from the player to the master object when a transition occurs.
Thanks in advance!
I'm making a metroidvania (I know it's not the best idea for a first game) and my first idea was to make a master persistent object from the first room to handle some "global" variables, but the player object still had it's own variables (hp, max_hp, status, etc.), this became a problem when I implemented transition between rooms and I created a new player object in the new room.
I've heard about ds_maps but still haven't played with them, my next idea is to make the master object to hold the player variables, but I wanted to know what would be the best way to handle this, maybe a ds_map in the master object with the player variables, but the player still having the same variables, just copying them to the player object every time it is created in a new room and copying them from the player to the master object when a transition occurs.
Thanks in advance!