Love2d Timestep and keypress (with repeat) not updating correctly?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Love2d Timestep and keypress (with repeat) not updating correctly?

Post by ivan »

Looks ok. Just set your tick rate to a reasonable value like at least 10ms per tick and you'll be fine.
Another thing you should consider is vsync.
I'm not 100% sure, but love.graphics might have to "busywait" for vsync in your case (since you're calling love.draw by hand).
Perhaps somebody with more knowledge of love.graphics can confirm.
m0nkeybl1tz
Prole
Posts: 14
Joined: Fri Jan 22, 2016 3:25 am

Re: Love2d Timestep and keypress (with repeat) not updating correctly?

Post by m0nkeybl1tz »

Sorry to dig up an old thread, but I'm trying to implement some physics in my game and I think a fixed timestep might help, however when I add this to my main.lua file it completely tanks the framerate. Is there something I'm doing wrong?
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Love2d Timestep and keypress (with repeat) not updating correctly?

Post by ReFreezed »

As ivan said above, make sure the tick rate isn't unreasonably fast. And disable vsync.

(It would help if you shared the code you have so we don't have to guess what's wrong.)
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
m0nkeybl1tz
Prole
Posts: 14
Joined: Fri Jan 22, 2016 3:25 am

Re: Love2d Timestep and keypress (with repeat) not updating correctly?

Post by m0nkeybl1tz »

Ahhh good call, it was the vSync. Even at a 30 tick rate it wasn't working, but now it does, thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests