Not jumping through top tile
-
I'm playing around with the tutorial game and when I jump with a tile right above me I get stuck in it and the go right through to the top!
-
I can't guarantee this is the best way, but I seem to have got it working by adding a collision check around line 207 which resets the velocity to 0 if true:
if collision( playerX + psize.x / 2, playerY + velocity) then velocity = 0 endif
This doesn't work if the tiles are only 1 space apart though, as the character is too tall to fit between them. It also makes more clear the collision problems moving left and right so more checks are probably needed, but see what you think :)
-
@kat awesome thanks so much I'll give it a try
-
@kat it works amazingly thanks
-
Great! Glad I could help 😊