Hi! I'm trying to come up with an idea for having the player respawn in the last "safe spot" before they've fallen into a pit, water, et cetera. I'd like to here some opinions and ideas as to how the best way to implement this would be! :3
Right now, my current idea is to have the player's previous coordinates be saved in an array each time they take a step-- perhaps up to last 100 steps or so-- and having it kind of go from most recent coords to oldest looking for a spot where the player wouldn't be colliding with the pit. Is this a good way to implement it? Let me know! :D