endlesstravel / Love2dCS

C# Wrapper for LÖVE, a 2d game engine
MIT License
166 stars 14 forks source link

How to use dt in love.KeyPressed? #107

Open rishavs opened 4 years ago

rishavs commented 4 years ago

the callback for love.KeyPressed takes only 3 args: key, scancode and isRepeat. It doesnt takes takes dt as an argument.

Should I use Love.Timer.GetDelta() in my KeyPressed callback?

Also, do you have a short snippet of using isRepeat in love.KeyPressed callback? For example, I am not sure how should I use the isRepeat value to move a ball with x and y position.

Finally, is there any chat channel where the community can be active in? some of these questions are not really issues and I hope I am not polluting the repo with them.

endlesstravel commented 4 years ago
matej-zajacik commented 4 years ago

I usually have a global DeltaTime that I set once per frame before everything else, and everything that needs a delta time simply reads this value. So I never pass a delta time in specific functions. Very simple.