been playing around with something in the update60() function and when i added my jump code and started jumping it would do so as if there were different variables for jumping and gravity, sometimes causing it to stutter when descending. does anyone know what's going on/how to fix it?
I took a quick look --
Sometimes I am able to press the buttons such that jmp is ping-ponging between -0.75 and 0.25. I believe the issue is this code:
if jmp<0 then jmp+=1 elseif jmp>0 then jmp-=1 end |
This is causing 'y' to increase and decrease rapidly. You can fix this how you like. Here is a quick fix: When I use the floor function to remove the fractional numbers, I am getting a smoother jump with consistent height.
if btn(❎) and ground then jmp-=6.25 ground=false end if btn(🅾️) and ground then jmp-=6.25 ground=false end jmp = flr(jmp) |
[Please log in to post a comment]