I am trying to make a basic game where the character can jump up and move around. I found few tutorials on gravity/jumps for pico8 but used that knowledge for my game. Where I run the code the character can jump and move but falls down if I don't press jump and does not stop at the floor. Please help me find a solution or send me the fixed code. cart below
Happy to help but to start it looks like you exported your sprite sheet and not the cart. You can probably find it fastest by looking in your user folder for "Pico-8/Carts".
To start answering your question though you need to make sure you're at least checking the height of the character with an if statement and if its more than the bottom of the screen set the players Y value to 128 minus the height of the sprite, which looks to be 8.
You might want to watch this video series I found that's making exactly what I think you're trying to go for. They're making a platformer and seem to go through all the basics.
[Please log in to post a comment]