Hello everyone! I'm developing a platformer based on My Hero Academy and for some reason, my player is able to jump while touching a jump-through tile, when they should only be able to jump if they're on top of it.
Does anyone know why this happens?
Code for jumping:
--jump if btn(❎) and player.landed then player.dy-=player.boost player.landed=false end |
Code for landing:
if collide_map(player,"down", flags.base) then player.landed=true player.falling=false player.dy=0 player.y-=((player.y+player.h+1)%8)-1 |
Cartridge below 👇
I was trying to run Pico8 with joystick on linux and wasn't being able to.
Until I saw this reddit post: https://www.reddit.com/r/EmuDeck/comments/17dohf8/comment/kspg7o8/
The fact that he was using a steam deck made me think our issues could be related. I then checked the config.txt and the following line:
// Specify which player index joystick control begins at (0..7)
joystick_index 1
Was defaulting joystick's behavior to player 2 instead of 1, even though the index is stated to start at 0 on the comment.
I then changed to this
// Specify which player index joystick control begins at (0..7)
joystick_index 0
And now I can get it to work. Maybe the default behavior was supposed to be joystick to player 1?