Hi, I'm trying to make a platformer, but the most I can accomplish for jumping is just up and down. I need to be able to move left and right while in mid-jump, but I can't find anything to help me with that...if anyone can help, that would be great! The script I'm using right now is
when gf clicked forever if <key [up arrow v] pressed?> set [gravity v] to [15] change y by (10) repeat until <touching color [white] ?> change [gravity v] by (-1) change y by (gravity) end end endit also won't let me fall off platforms, insteadi just walk out onto thin air!
Offline
Go here to read what the Wiki editors have to say about jumping. The most realistic jumping script is at the bottom.
Offline
As long as you can move on the ground left and right, it should still work in the air. Just hold the up and left keys together, or right key and up, it should work.
Offline
Don't use a 'repeat until touching ground'. Add a separate 'if' statement for what to do when it's touching the ground (make it set its y velocity to 0 or something), and leave the part where your gravity variable decrements and the part where the object moves outside the 'if' statements. Then add in 'if' statements for movement left and right.
Offline