Log In  

Cart #sixzerofps-0 | 2021-02-23 | Code ▽ | Embed ▽ | No License

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?

P#88051 2021-02-23 11:03

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)
P#96896 2021-09-05 17:32

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 20:08:23 | 0.009s | Q:16