Skip to main content
7 events
when toggle format what by license comment
Dec 23, 2017 at 0:30 vote accept user
Dec 23, 2017 at 0:26 comment added Charanor @Draco18s I would suggest reading the paragraph just below the first code snippet where I talk about exactly that ;)
Dec 23, 2017 at 0:25 comment added Draco18s no longer trusts SE System.Time is a bad choice. What if the user pauses the game?
Dec 23, 2017 at 0:21 comment added Charanor @user and if you think about it this way - chances are you will still overshoot the 45 second mark (at least by some hundredth of a second) since your delta time is not always a stabile 60. If you drop to 59 FPS for one frame you have to wait a whole extra \$1 / 60\$ seconds for the bomb to explode! But when we get to this level of nitpicking there is literally nothing we can do to fix it and just have to accept that sometimes the bomb will be \$1 / 60th\$ of a second faster or slower to detonate (which is fine, since it's barely noticeable!).
Dec 23, 2017 at 0:11 comment added Charanor @user floating point errors are most likely not large enough for this to be a problem. Even if the floating point error was something like 0.001 (\$10^{-3}\$) it would take 1000 seconds before there was a 1 second difference. But also this is probably not going to be a problem anyways since precision errors go both ways, so one frame you might have say \$0.001\$ error and the next you might have \$-0.001\$ error so they balance out to \$0.000\$ error in the end :)
Dec 23, 2017 at 0:08 comment added user I was worried if there are accumulating floating-point rounding errors when subtracting the delta time, and it would explode after 44-46 seconds instead of 45.
Dec 22, 2017 at 23:49 history answered Charanor CC BY-SA 3.0