monoclex / smiley-face-game

https://smiley-face-game.sirjosh3917.com/
GNU Affero General Public License v3.0
8 stars 0 forks source link

Make zoosts less buggy #165

Closed monoclex closed 2 years ago

monoclex commented 2 years ago

Currently, a zoost inside of a half slab will cause the player to teleport through them in the right and down directions, but not the other two directions.

image

It is not possible for zoosts to be made working in the left and up direction as that's extremely hacky, and would mean that the block the player activates isn't always the same as EE. Thus, we opt for fixing the right and down cases.

Firsly, we will make zoosts actually move the player until they collide with something, 1 pixel at a time (conceptually one pixel at a time. Actual implementation may differ). Then, once they collide, we stop. This will prevent the player from going through the half slaab, and also reaching the complete end of other half slab blocks.

Next, there's a problem where zoosts will clamp you to the center of the block. Because we perform collision one pixel at a time, we are free to not clamp the player to the center of the zoost before teleporting them anymore.

After both fixes are impemented, the right and down cases of zoosts will behave the same as the left and up cases - resolving the bug.