When a player falls into a hole, they should be damaged once and relocated to their last safe position.
To implement this, update a last_safe_position variable every frame if the player's position is considered safe.
A position is safe if there are no holes within some small radius of the player (they should not be relocated a pixel away from the edge).
(Current behavior just teleports them away from the hole node's position by a constant amount. this happens every frame, so it typically kills the player instantly.)
When a player falls into a hole, they should be damaged once and relocated to their last safe position. To implement this, update a
last_safe_position
variable every frame if the player's position is considered safe. A position is safe if there are no holes within some small radius of the player (they should not be relocated a pixel away from the edge).(Current behavior just teleports them away from the hole node's position by a constant amount. this happens every frame, so it typically kills the player instantly.)