New answers tagged

1

In native code, where you're using a while loop you've set up in main, this is exactly how all checks are done. There is in fact no other way to do it, under these circumstances, since the native while loop runs as fast as possible and only acts when some condition is met (like yours). In non-native framework code or for certain platforms (like JS), there ...


1

This is unlikely to be an issue. A single branch 60 times a second is not even a blip on the radar for a profiler. However if you have arbitrary events that trigger at certain points (not just on turn of day) then you can make newDay a fixed recurring daily event. Then the update loop will be: void Update(float _delta) { gameTimeInSeconds += _delta * ...



Top 50 recent answers are included