p3nGu1nZz commited on
Commit
1614d87
1 Parent(s): 480409f
Files changed (1) hide show
  1. index.js +3 -3
index.js CHANGED
@@ -79,13 +79,13 @@ function GenerateIndices(maxGlyphs) {
79
  }
80
 
81
  function GameLoop() {
82
- state.lastTime = performance.now();
83
  state.timing.accumulator = 0;
84
 
85
  function Tick() {
86
  state.timing.currentTime = performance.now();
87
- state.timing.frameTime = (state.timing.currentTime - state.lastTime) / 1000;
88
- state.lastTime = state.timing.currentTime;
89
 
90
  state.timing.deltaTime = Math.min(state.timing.frameTime, state.timing.maxFrameTime);
91
  state.timing.accumulator += state.timing.deltaTime;
 
79
  }
80
 
81
  function GameLoop() {
82
+ state.timing.lastTime = performance.now();
83
  state.timing.accumulator = 0;
84
 
85
  function Tick() {
86
  state.timing.currentTime = performance.now();
87
+ state.timing.frameTime = (state.timing.currentTime - state.timing.lastTime) / 1000;
88
+ state.timing.lastTime = state.timing.currentTime;
89
 
90
  state.timing.deltaTime = Math.min(state.timing.frameTime, state.timing.maxFrameTime);
91
  state.timing.accumulator += state.timing.deltaTime;