Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello Peter
There is a small problem with corner correcting. If you jump and hit the corner, jump shortens as it uses previous frame's vsp.
In Mario games, player just gets corrected around the corner and it doesn't shorten the jump height.
Do you have any idea how to get around that?
I tried to make _vsp_previous the same as jump_height, but then it is too high because we normally use gravity to slow down the vsp.

Hey joe,

I notice what you are referring to, and have now fixed it to ensure it works as you explained.  I've uploaded a new version with the changes, v1.0.36.  If you want to copy/paste the new code to your version, just look in the collision function and it's the code under the "corner correction" section, lines 129 - 160.

Hopefully it all works as expected, just let me know if there are any issues.

Cheers,

Peter

Wow, that was quick. Thank you very much. I wouldn't come up with a solution in a week :)
Works great but, there is a small bug, if we clip the corner jump is one pixel higher then if we don't clip the corner.

(3 edits)

You're welcome, thanks for pointing out the issue.

The single pixel is interesting.  Here is a vid from my testing.  The value is the y position the player reaches when we either jump normally or jump into a corner.  Both produce the same result of 498.  Have you changed the game resolution maybe?

I'm sorry, problem was with my modified collision code.
It works fine if I comment out this line:

if tilemap_get_at_pixel(global.map, bbox_left, bbox_top - 1) == VOID y -= 1;   

Perhaps I had the problem because I don't use decimals.
I modified the collision code so it works nice without decimals so I get smooth movement.