Hi all!

I am working on a small pong clone:

https://www.lexaloffle.com/bbs/?tid=29815

I am unable to solve the paddle movement jerkiness.

It is working perfectly if I move 1px per time but, if I increase paddle speed, it becomes really...

Bad.

Any suggestions?

Thanks for your time and patience :)

Hi solar!

Thanks for your kind help :)

I've read it but I am a simpleton and my mind is now blown:

https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif

What should I do?

As far as I've understood I should change the speed of the pads but I am unsure of the formula I should apply...

Hi guys!

While I was lurking like crazy on the forum I've found another priceless gem from ultrabrite and it works like a charm to solve my issue.

I cannot find the link again because I am a silly person but I've kept what he wrote.

What ultrabrite wrote:

--wrap around

if btn(0) then ship.x=(ship.x+127)%128 end

if btn(1) then ship.x=(ship.x+1)%128 end

-- more generally

ship.x=(ship.x+128+dx)%128

--walls

if btn(0) then ship.x=max(0,ship.x-1) end

if btn(1) then ship.x=min(ship.x+1,128) end

-- more generally

ship.x=mid(0,ship.x+dx,128)

[Please log in to post a comment]