requestAnimationFrame test
@@ -63,5 +63,7 @@ var GameWindow =
63
63
GameWindow.canvasContext.fillRect(0, 0, GameWindow.width, GameWindow.height);
64
64
65
65
Player.draw3D();
66
67
requestAnimationFrame(GameWindow.redraw);
66
68
}
67
69
}
@@ -63,5 +63,7 @@ var GameWindow =63
GameWindow.canvasContext.fillRect(0, 0, GameWindow.width, GameWindow.height);63
GameWindow.canvasContext.fillRect(0, 0, GameWindow.width, GameWindow.height);64
64
65
Player.draw3D();65
Player.draw3D();66
67
requestAnimationFrame(GameWindow.redraw);66
}68
}67
}69
}@@ -28,10 +28,12 @@ window.onload = function()
28
28
GameInput.g_updateKeys();
29
29
Player.update(stepTimeCurr);
30
30
31
GameWindow.redraw();
31
32
32
33
33
this.stepPrevious = stepTime;
34
34
}, 20);
35
36
GameWindow.redraw();
35
37
}
36
38
37
39
var stepPrevious = 0;
@@ -28,10 +28,12 @@ window.onload = function()28
GameInput.g_updateKeys();28
GameInput.g_updateKeys();29
Player.update(stepTimeCurr);29
Player.update(stepTimeCurr);30
30
31
GameWindow.redraw();31
32
32
33
this.stepPrevious = stepTime;33
this.stepPrevious = stepTime;34
}, 20);34
}, 20);35
36
GameWindow.redraw();35
}37
}36
38
37
var stepPrevious = 0;39
var stepPrevious = 0;