I had it previously to where I would have a hole check before any movement was done, and also it relied on doing a position_meeting check for that each step to keep track of your last viable position. Hypothetically it might be better to do the check only in the movement, as that way you wouldn't need to keep track of your last viable position; e.g., if you were going left/right into a hole, if you ran into a hole it would know that if you are not in the hole state your last position must have been viable - Link's position then is just his x minus the pixels he moved, and then the x,y coordinate that forms needs to be modulused to the center of the viable grid-space, the view then transitioning back to being as over Link as it can, and then having control return to Link.