Log In  

So I'm converting my game OBSTACOURSE (builds here: https://www.lexaloffle.com/bbs/?tid=37669) to 60 fps but am finding it difficult to get the jump to not be so fast (the value for the jump is -9 so it moves at the speed too)

jump at 60fps

jump at 30fps

My jump code is currently

if btn(❎) and ground then
    jmp-=9
    ground=false
 end

and I've been using the code below to change the animation speed but having trouble adapting it for the jump, does anyone know what/how I should do this?

if time() - ani_time > wait then
 s+=1
 ani_time=time() end
P#81107 2020-08-24 10:43 ( Edited 2020-08-27 16:23)

I'd recommend just cutting your gravity and movement/acceleration speed constants in half. That way you won't have to spend extra tokens on translation code that could end up causing bugs. So instead of delaying jump animation, for instance, you could just make the upward jump acceleration -4.5 instead of -9, as long as you cut the gravity in half.

P#81111 2020-08-24 15:27 ( Edited 2020-08-24 15:42)

The movement/acceleration and gravity isn't the problem, more finding a way for the first half of the arc of the jump to meet the height I want it to and to have the same speed as the gravity/second half of the arc of the jump

EDIT: my jump code doesn't include an acceleration variable, just the height it goes to.

P#81113 2020-08-24 15:53 ( Edited 2020-08-24 15:55)

[Please log in to post a comment]