Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE mbed wave_player
Fork of MazeRunner_Fall2017-shell by
Revision 2:c18c231cb299, committed 2017-11-08
- Comitter:
- rconnorlawson
- Date:
- Wed Nov 08 21:01:43 2017 +0000
- Parent:
- 0:cf4396614a79
- Commit message:
- Fix delta computation in physics update.
Changed in this revision
| game.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- a/game.cpp	Fri Nov 03 18:48:48 2017 +0000
+++ b/game.cpp	Wed Nov 08 21:01:43 2017 +0000
@@ -90,11 +90,12 @@
         // Physics Update
         ///////////////////
         // Rate limit: 1 ms
-        if (tick - phys_tick < 1) continue;
+        int diff = tick - phys_tick;
+        if (diff < 1) continue;
         phys_tick = tick;
 
         // Compute elapsed time in milliseconds
-        float delta = (tick-phys_tick)*1e-3;
+        float delta = diff*1e-3;
 
         // Read inputs
         GameInputs inputs = read_inputs();
    