I think I'll never figure out how to use App.DeltaTime
Whatever I try, I can't make the game work similar at different FPS-s...
On my laptop I have 210 - 240 FPS, and the game works excelent, but on desktop I have 380 and the game runs very fast ... To be precise, I run forward and backward much faster, and rotate much slower ... :S
I'm posting my project file, and I'm asking anyone here to help me ...
thank you
Boris
Need help with App.DeltaTime
Moderator: Moderators
Need help with App.DeltaTime
- Attachments
-
- game.zgeproj
- (28.73 KiB) Downloaded 474 times
Hi!
From your "up arrow" code:
I'm not sure how those variables are used, but in general this kind of variable update should take deltatime into account.
For example:
Where CameraSpeed is a constant. To set a good value for the speed, remember that thanks to the multiply with deltatime which is in seconds the unit of the CameraSpeed value is also in seconds. In other words CameraSpeed=amount to move the camera in one second. So it could be set to 1.0 for example.
Hope that helps! I like the movement of the camera in your project.
From your "up arrow" code:
Code: Select all
distance += 0.1;
AngleView += 0.0005;
CameraHeight += 0.1;
For example:
Code: Select all
distance += CameraSpeed * App.DeltaTime;
Hope that helps! I like the movement of the camera in your project.