Merge branch 'master' of https://github.com/teamsnowman/wastedtime
This commit is contained in:
commit
0e0a25eaf3
1 changed files with 21 additions and 1 deletions
22
main.js
22
main.js
|
@ -1 +1,21 @@
|
|||
// main thing here
|
||||
// main thing here
|
||||
|
||||
window.requestAnimFrame = (function(){
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function( callback ){
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
})();
|
||||
|
||||
(function animloop(){
|
||||
requestAnimFrame(animloop);
|
||||
render();
|
||||
})();
|
||||
|
||||
function render() {
|
||||
// game code
|
||||
|
||||
requestAnimFrame(animloop);
|
||||
}
|
Loading…
Reference in a new issue