Creating a Game Loop in a Windows Store Game using HTML and JavaScript
-
Upload
david-isbitski -
Category
Technology
-
view
2.491 -
download
0
description
Transcript of Creating a Game Loop in a Windows Store Game using HTML and JavaScript
Creating a Game Loop in a Windows Store Game using HTML and JavaScript
Dave IsbitskiTechnology Evangelist, Windows 8twitter.com/TheDaveDevblogs.msdn/com/[email protected]
win8gamekit.codeplex.com
var FPS = 30;
init(){ // Load content/graphics here
// Start game loopsetInterval(gameLoop, 1000/FPS);
}
gameLoop(){// Update (Figure out what’s happening)// Draw (Show what’s happening)
}
setInterval
function update() {
//RequestAnimationFrame faster pef than setInterval anim = window.msRequestAnimationFrame(update);
if (menuEnabled) { drawStars(); } else { //Game Loop updateShips(); drawShips(); }}
requestAnimationFrame
http://msdn.microsoft.com/en-us/library/ie/hh920765(v=vs.85).aspx
Now is the time to write your game. Enjoy the first to market advantage!
twitter.com/thedavedev | [email protected]
http://bit.ly/genapp8