200 likes | 341 Vues
HTML5 Game Engines. 1. DanNagle.com. Write Once. Run Anywhere. . 2. DanNagle.com. HTML5 Standard. HTML4 – 1997 HTML5 – 2012 (Living). 3. DanNagle.com. HTML5 Standard. HTML4 – 1997 HTML5 – 2012 (Living). 4. DanNagle.com. Audio Canvas CSS3 Device API File API Geolocation
E N D
HTML5 Game Engines 1 DanNagle.com
Write Once. Run Anywhere. 2 DanNagle.com
HTML5 Standard HTML4 – 1997 HTML5 – 2012(Living) 3 DanNagle.com
HTML5 Standard HTML4 – 1997 HTML5 – 2012(Living) 4 DanNagle.com
Audio • Canvas • CSS3 • Device API • File API • Geolocation • Microdata • SVG • Web SQL Database • Web Sockets • Web Storage • Web Workers • WebGL New Features 5 DanNagle.com
<audio> </audio> 6 DanNagle.com
<audio> </audio> 7 DanNagle.com
<audio> </audio> 8 DanNagle.com
if ($.browser.webkit) { } if ($.browser.mozilla) { } if ($.browser.msie) { } Wrong! 9 DanNagle.com
if(Modernizr.audio) { if (Modernizr.audio.mp3) { } if (Modernizr.audio.ogg) { } if (Modernizr.audio.wav) { } } Feature Detect 10 DanNagle.com
EaselJS <canvas> </canvas> 11 DanNagle.com
var manifest = [ {src:"sprites.png", id:"sprites"} ]; var loader = new createjs.LoadQueue(false); loader.onComplete= handleComplete; loader.loadManifest(manifest); Preload 12 DanNagle.com
Crafty.e("gameBall, 2D, Canvas, Collision") .onHit(gamePaddle', function () { //handle hit }) Collision 13 DanNagle.com
varfireBallsheet={ "animations": { rolling: [0, 3] }, "images": [“sprites.png"], "frames": { "height": 16, "width": 16} }; varfiress= new createjs.SpriteSheet(fireBallsheet ); Sprite sheets 14 DanNagle.com
Crafty.e("bottomPaddle, 2D, Canvas, Multiway") .multiway(4, { LEFT_ARROW: 180, RIGHT_ARROW: 0 }) Keyboard 15 DanNagle.com
goog.events.listen(mainScene, ['mousedown','touchstart'], function(e){ //handle touch }); Touch / Mouse 16 DanNagle.com
update: function() { //every frame this.parent(); }, Tick 17 DanNagle.com
Levels 18 DanNagle.com
Levels 19 DanNagle.com
developer.mozilla.org CraftyJS.com HTML5Test.com Modernizr.com LimeJS.com CreateJS.com whatwg.org/html ImpactJS.com Further Reading 20 DanNagle.com