#Respawning character after falling, drowning, etc

1 messages · Page 1 of 1 (latest)

modest dove
#

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

faint cipher
#

There’s different ways one could implement this. An array that records the last dozen or more steps, works

#

Is this grid based movement or pixel based?

modest dove
#

Pixel based!

faint cipher
#

Yeah, I’d say an array of 10-tile size will do nicely