hawkthorne / hawkthorne-journey

Digital Estate Planning: The Game
projecthawkthorne.com
1.09k stars 452 forks source link

Addresses two common collision issues #2584

Closed Protuhj closed 2 years ago

Protuhj commented 2 years ago

The first is when you attack soon after crouching. If you timed it just right, attacking just before you went under a low ceiling would cause you to stand up and clip into the ceiling.

The second, which is related to the first, would happen if you stood up right at the edge of a ceiling. The code would find a tile above the character instead of below, since even when standing still, gravity causes the collision code to run assuming you're falling down.

Both of these situations are easiest to reproduce when on a moving platform.

I tested this extensively with --level=black-caverns-2 --cheat=give_master_key:

I'd suggest trying to cause it in the current version of the game, so you get the key presses that cause the issue

Attempts to address #2578 and #2456.

For #2578, I'm not sure how to have a repeatable test with being hit by a bat to knock you into the ceiling.

Also note that I'm testing at 144FPS and I think it's easier to reproduce at a lower framerate.

niamu commented 2 years ago

I am no good at being able to replicate the issue in the first place, but the code makes sense to me so I'd be willing to accept this in its current state. If no one else chimes in we can merge this.