SlideShare a Scribd company logo
THE COMPLETE GUIDE
TO BUILDING HTML5
GAMES
2013.4.17 동국대학교 이창환
• yich@dongguk.edu
• http://html5gamers.wordpress.com
2




• The Complete Guide to Building HTML5 games
   • David Rousset
     • A Developer Evangelist at Microsoft, specializing in HTML5 and web
       development.
     • Blog on MSDN
     • Twitter: @davrous

     • Links
        • http://www.codeproject.com/Articles/485747/The-Complete-Guide-to-Building-
          HTML5-games-with-Ca, 2012-10-29
        • http://html5center.sourceforge.net/The-Complete-Guide-to-Building-HTML5-games-
          with-Canvas-SVG


• This slide
   • https://www.slideshare.net/yich/w3c-kigthe-complete-guide-to-building-
     html5-games
3




• Why are so many people currently interested in HTML5
 Gaming?
 • HTML5 to target multi-platforms using the same code
   • for desktop machines of course (with IE9/IE10, Firefox, Chrome, Opera
     & Safari)
   • for iOS & Android tablets & phones and Windows 8
   • its future associated millions of tablets & PC

• The modern JavaScript engines performance + the GPU
 hardware-accelerated graphics layers
4




• Building HTML5 game
  • How to draw nice objects on the screen.
    • Patrick Dengler (member of the SVG W3C Working Group): Thoughts
      on when to use Canvas and SVG


• David Rousset’s materials
  • Overview of HTML5 Graphics with Canvas & SVG
    • Video: mp4, WebM
    • Source Codes


• Other sessions from MIX11
  • Modernizing Your Website: SVG Meets HTML5
  • Deep Dive Into HTML5 <canvas>
5




Canvas vs. SVG
• Canvas vs. SVG
  • Canvas
    • a well-known development model for games developers (low level
      drawing APIs)
    • hardware-accelerated by most of the recent browsers.
  • SVG, and its vectors-based technology
    • Better armed to scale across devices without loosing quality.
    • ViewBox property of SVG
    • Games assets-Scale from 3 to 80'' screens



• Example game using both technologies.
  • SVG Racketball & Canvas Racquetball
  • Programming Simple Games Using Canvas or SVG
6




Performance of Canvas and SVG
• 1000 small balls on screen
   • Using SVG: 1000 balls in SVG
   • Using Canvas: 1000 balls in Canvas


  • Environment
     • Intel i7-3770 with 8GB
     • Windows 7 (32bit)
     • Chrome 26
7




Performance of Canvas and SVG
• Performance Comparison
  • Better for drawing a lot of objects on the screen
  • To achieve in video games
8




• Mixing both technologies
  • A first layer based on SVG to display the game menus
  • A second layer in background using a canvas for the game itself.


  • Some attentions to final performance results
    • Because the browsers & devices are far from being equals in this
      domain.
    • Don't forget that the main interest of HTML5 is to target all platforms.
9




• David Catuhe’s little brick breaker
 game
  • Using this composition principle
  • How to write a small game using HTML5
   and JavaScript-BrikBrok

  • The first layer using SVG for the bricks to
    break
  • The background with a tunnel effect using
    the canvas tag.

  • Mimic this concept
    • The main game in background (hosting a
      plateformer or shoot'em up game, etc.)
      instead of the tunnel
    • first layer: the menus & configuration options
      in SVG.
10




Useful libraries & tools
• Graphics
• Physics Engine
• Handling the multi touch events
• Building connected games
11




Graphics
• Writing the XML nodes of SVG manually or even playing
 with the low level APIs of Canvas
  • Be fun for a moment but not very productive.


• Useful set of tools & libraries for building parts of HTML5
 game.
  • Some SVG tools
    • InkScape: a free & open source desktop software
    • SVG Editor: an online software running directly inside your browser
    • Adobe Illustrator: Supports SVG as an export target, expensive.
  • Game assets (for menus or controls)
    • The Noun Project : free icons library
    • Open Clip Art Library: free SVG content
12




Graphics
• Libraries (SVG)
  • RaphaelJS: SVG JavaScript library
     • Generating dynamic SVG with few lines of code.
     • Demo using for instance nonlinear animation functions on SVG elements, animated charts,
       etc.
  • HighCharts: charting
     • To display some players' stats


  • Those 2 libraries
     • Implement VML fallbacks for IE8 or older versions.
     • Target at least IE9 and above.
13




Graphics
• Libraries (Canvas)
   • JavaScript InfoVis Toolkit: Charts using Canvas
14




Graphics
• Libraries (3D)
   • ThreeJS: the usage of 3D in JavaScript
    • Be used to render some hardware-accelerated 3D via WebGL.
    • For a rendering inside the 2D canvas element of HTML5.
       • "CanvasRenderer examples" section
       • Used for instance to build our Galactic demo on the IE Test Drive.
       • Build 3D scenes working in all HTML5 browsers.


• Note
  • Combine all of these graphics effects with the usage of:
    • CSS3 2D & 3D Transforms
    • Transitions
    • Animations
  • To stay focused on Canvas & SVG in this article.
15




Physics Engine
• To do in a game
   • Displaying graphics
   • The AI (Artificial Intelligence): To bring life to your characters.
     • Code that alone and be creative
  • The physics & collisions: Box2D JS

• Libraries
   • Box2D JS
     • with the various samples and you'll be amazed:

     • Tutorials series of Seth Ladd
        • Box2D orientation for the JavaScript developer
        • Used the Web Workers to compute the physics on the several available cores of
          your CPU.

  • An introduction on Web Workers APIs
     • Introduction to the HTML5 Web Workers: the JavaScript multithreading
       approach
16




Handling the multi touch events
• Support touch for building a cross-devices game
  • 2 existing specifications around Touch Events
     • Pointer Events vs. Touch Events


  • Getting Touchy About Patents


  • Need to write code working fine inside IE10 & Windows 8 as well as with the
    implementation coming from the Apple devices.

  • Finger Painting: Sample demonstrating a possible pattern to support both kind of
    touch events
     • Handling Multi-touch and Mouse Input in All Browsers


  • Browser Surface: Demo for handling multi-touch inside IE10.
     • Need a recent IE10 version and a multitouch hardware running it.
17




Handling the multi touch events
• Pointer.js
  • Boris Smus

  • The idea
    • To consolidate all types of touch (IE10, iOS like, mouse and pen) to simplify
      your developer life.

  • Generalized input on the cross-device web.

  • Current
    • A draft
    • No support yet the MSPointer* of IE10.
18




Building connected games
• WebSockets
  • Build multiplayers games or a connected game to a server
  • W3C specification (and the underlying protocol handled by the
    IETF)

  • To support the widest possible number of users
    • Consider a fallback for browsers or devices which weren't supporting
      WebSockets yet or were supporting an older deprecated version.


  • 2 solutions
    • Socket.IO library for Node.js
    • SignalR working on top of IIS and ASP.NET


    • handle all the browsers & devices with their variety of support levels.
19




Some gaming frameworks
• To build a 2D HTML5 game
   • 1 - Handling your sprites: splitting them into a sequence,
     animating them, effects, etc.
   • 2 - Handling your sounds & music (and this is not something
     easy in HTML5!)
   • 3 - Loading asynchronously your assets from the web server via
     a dedicated loader/assets manager
   • 4 - Building a collision engine, a high level logic for your game
     objects, etc.

• 2 Way to build a 2d HTML5 game
   • Do that starting from scratch
   • Test & review what other brilliant developers have already done on
     the web.
20




Some gaming frameworks
• The most well-known frameworks for building HTML5 2D
 games working inside all browsers:
 • MelonJS: A free framework that exposes a lot of useful services.
   • Works fine with the Tiled Map Editor tool.
 • CraftyJS
 • ImpactJS: a high quality well-known framework. It's not free but not
   too much expensive.
 • EaselJS: Written by an old flash developer.
   • Part of the CreateJS suite.
   • It's very complete, well documented and… free.
21




Some beginners' tutorials
• Tutorials
   • porting an XNA C# game into HTML5/JavaScript thanks to EaselJS.

  • HTML5 Gaming: animating sprites in Canvas with EaselJS
  • HTML5 Gaming: building the core objects & handling collisions with EaselJS
  • HTML5 Platformer: the complete port of the XNA game to <canvas> with EaselJS


• 3 others articles enhancing/extending the same game:
   • Tutorial: how to create HTML5 applications on Windows Phone thanks to PhoneGap
     • how to port the same game on Windows Phone thanks to PhoneGap/Cordova.
     • the same instructions for your Android or iOS device.

  • Modernizing your HTML5 Canvas games Part 1: hardware scaling & CSS3
     • use CSS3 3D Transform, Transitions & Grid Layout to enhance the gaming experience

  • Modernizing your HTML5 Canvas games Part 2: Offline API, Drag'n'drop & File API
     • enable playing to the game in offline mode.
     • create your own levels and drag'n'drop them directly into the game.
22
23




• Tutorials on the EaselJS
   • a lot of simple demo to understand and great tutorials on the EaselJS
     website:http://www.createjs.com/#!/EaselJS

• More generic tutorials on :
  • HTML5 Game Dev Tutorials
  • 10 cool HTML5 games and how to create your own

• 2 more "advanced" articles
   • David Catuhe from Microsoft:
     • Unleash the power of HTML 5 Canvas for gaming.
     • Some optimization: Writing in the "demo scene".
     • The tips: Some ideas for HTML5 games.

  • Boris Smus from Google
     • Improving HTML5 Canvas Performance and it contains ton of good advices.
24




Some interesting online working games & experience feedbacks

• Other cool examples on the web to share.
  • Be interesting to analyze how the developers made them.
  • Thanks to the magic of the web: right-click & "view source".
  • Be probably minified,
    • Can still learn a couple of interesting things by looking at the global
      architecture of the game.


• Pirates Love Daisies written by Grant Skinner:
  • using the EaselJS framework.
25




• Windows 8 note
  • Windows 8 in the Windows Store
    • Pirates Love Daisies for Windows 8.
  • A HTML5 game working fine inside IE9 or IE10, building the
   Windows 8 version is almost only doing a simple copy… and
   paste
    • The game will then directly works inside the Metro experience.
  • To make a real good Windows 8 game
    • pay attention to the unique Windows 8 experience we're building.
    • Designing great games for Windows
26




• BKOM ROBOT GAME
  • Using EaselJS
  • Uses 3D sprites
27




• The 2 most currently famous HTML5 games
  • Angry Bird
   • Uses the Box2D library
 • Cut The Rope
   • a Windows 8 version of it in the Windows Store here: Cut The Rope for
    Windows 8
28




• To port into Windows 8.
   • 1 - Copy/Paste the Web version into a HTML5 Metro Style App project for
     Windows 8
   • 2 - Add support for touch
   • 3 - Add support for the snapped view and pause the game
   • 4 - Build some High Resolution assets (1366x768 & 1920x1080) to propose
     the best experience for all the incoming Windows 8 tablets & PC.

• The story around "Cut The Rope“
   • a successful game written in Objective-C for the Apple iOS devices.
   • Ported into HTML5/Canvas and the developers who made this detail their
     feedback in this article: Cut The Rope - Behind the scenes

• Experience feedback: Wooga's HTML5 Adventure

• 40 more or less good HTML5 games
   • 40 Addictive Web Games Powered by HTML5 with some other available also
     here: HTML5games.com

More Related Content

PDF
Make your own Print & Play card game using SVG and JavaScript
PPTX
Mini-Training: Node.js
PDF
DevOpsCon 2015 - DevOps in Mobile Games
PDF
Figma, Storybook und Angular: Toolchain für plattformunabhängige UI-Entwicklung
PDF
Nuxeo World Session: Mobile ECM Apps with Nuxeo EP
PDF
"How to Develop with Qt for Multiple Screen Resolutions and Increase Your Use...
PDF
ProjectsSummary
KEY
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Make your own Print & Play card game using SVG and JavaScript
Mini-Training: Node.js
DevOpsCon 2015 - DevOps in Mobile Games
Figma, Storybook und Angular: Toolchain für plattformunabhängige UI-Entwicklung
Nuxeo World Session: Mobile ECM Apps with Nuxeo EP
"How to Develop with Qt for Multiple Screen Resolutions and Increase Your Use...
ProjectsSummary
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011

Similar to W3C HTML5 KIG-The complete guide to building html5 games (20)

PDF
HTML5 Games Status and issues
PPTX
Html5 Game Development with Canvas
PPTX
A Holistic Approach to HTML5 Game Design & Development
PPTX
Html5 (games)
PDF
HTML5 & JavaScript Games
ODP
HTML5 Game Development frameworks overview
PDF
Ready to Play: JavaScript / HTML5 Game Development
PPTX
HTML5 - Chances and Pitfalls (Bytro Labs GmbH)
PDF
From Flash to Canvas - a penchant for black holes
PDF
HTML5 Games for Web & Mobile
KEY
Seattle javascript game development - Overview
PPTX
Html5 Canvas and Mobile Graphics
PDF
Korea linuxforum2014 html5game-sangseoklim
PDF
One codebase, multiple platforms; Using HTML5/js for game dev
PPT
HTML5 Dev Conf 2013 Presentation
PDF
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
PDF
A Study of SVG-based Application Development @ OSDC 2010
PDF
Power of canvas
PPTX
Presentation3
PDF
Desingning reusable web components
HTML5 Games Status and issues
Html5 Game Development with Canvas
A Holistic Approach to HTML5 Game Design & Development
Html5 (games)
HTML5 & JavaScript Games
HTML5 Game Development frameworks overview
Ready to Play: JavaScript / HTML5 Game Development
HTML5 - Chances and Pitfalls (Bytro Labs GmbH)
From Flash to Canvas - a penchant for black holes
HTML5 Games for Web & Mobile
Seattle javascript game development - Overview
Html5 Canvas and Mobile Graphics
Korea linuxforum2014 html5game-sangseoklim
One codebase, multiple platforms; Using HTML5/js for game dev
HTML5 Dev Conf 2013 Presentation
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
A Study of SVG-based Application Development @ OSDC 2010
Power of canvas
Presentation3
Desingning reusable web components
Ad

More from Changhwan Yi (15)

PDF
Web sessions in Developer Conferences
PDF
JavaScript Engine and WebAssembly
PDF
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
PDF
Html5 게임 기술의 개요
PDF
동국대 앱창작터 5일차:Cocos2d-X 확장기능
PDF
동국대 앱창작터 4일차:Cocos2d-X 고급기능
PDF
동국대 앱창작터 2일차:Cocos2d-X 기본기능
PDF
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
PDF
W3C HTML5 KIG-The near future of the web platform
PDF
차세대 웹비즈니스를 위한 "HTML5"
PDF
WoO 2012-Web 서비스 기술
PDF
W3C HTML5 KIG-Typed Arrays
PDF
하이브리드 앱(Hybrid App)
KEY
W3C HTML5 KIG-How to write low garbage real-time javascript
PDF
W3C HTML5 KIG-HTML5 Game Performance Issue
Web sessions in Developer Conferences
JavaScript Engine and WebAssembly
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
Html5 게임 기술의 개요
동국대 앱창작터 5일차:Cocos2d-X 확장기능
동국대 앱창작터 4일차:Cocos2d-X 고급기능
동국대 앱창작터 2일차:Cocos2d-X 기본기능
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
W3C HTML5 KIG-The near future of the web platform
차세대 웹비즈니스를 위한 "HTML5"
WoO 2012-Web 서비스 기술
W3C HTML5 KIG-Typed Arrays
하이브리드 앱(Hybrid App)
W3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-HTML5 Game Performance Issue
Ad

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Mushroom cultivation and it's methods.pdf
MIND Revenue Release Quarter 2 2025 Press Release
SOPHOS-XG Firewall Administrator PPT.pptx
Machine Learning_overview_presentation.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Univ-Connecticut-ChatGPT-Presentaion.pdf
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative study of natural language inference in Swahili using monolingua...
Digital-Transformation-Roadmap-for-Companies.pptx
Tartificialntelligence_presentation.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence
Assigned Numbers - 2025 - Bluetooth® Document
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Heart disease approach using modified random forest and particle swarm optimi...
Mushroom cultivation and it's methods.pdf

W3C HTML5 KIG-The complete guide to building html5 games

  • 1. THE COMPLETE GUIDE TO BUILDING HTML5 GAMES 2013.4.17 동국대학교 이창환 • [email protected] • http://html5gamers.wordpress.com
  • 2. 2 • The Complete Guide to Building HTML5 games • David Rousset • A Developer Evangelist at Microsoft, specializing in HTML5 and web development. • Blog on MSDN • Twitter: @davrous • Links • http://www.codeproject.com/Articles/485747/The-Complete-Guide-to-Building- HTML5-games-with-Ca, 2012-10-29 • http://html5center.sourceforge.net/The-Complete-Guide-to-Building-HTML5-games- with-Canvas-SVG • This slide • https://www.slideshare.net/yich/w3c-kigthe-complete-guide-to-building- html5-games
  • 3. 3 • Why are so many people currently interested in HTML5 Gaming? • HTML5 to target multi-platforms using the same code • for desktop machines of course (with IE9/IE10, Firefox, Chrome, Opera & Safari) • for iOS & Android tablets & phones and Windows 8 • its future associated millions of tablets & PC • The modern JavaScript engines performance + the GPU hardware-accelerated graphics layers
  • 4. 4 • Building HTML5 game • How to draw nice objects on the screen. • Patrick Dengler (member of the SVG W3C Working Group): Thoughts on when to use Canvas and SVG • David Rousset’s materials • Overview of HTML5 Graphics with Canvas & SVG • Video: mp4, WebM • Source Codes • Other sessions from MIX11 • Modernizing Your Website: SVG Meets HTML5 • Deep Dive Into HTML5 <canvas>
  • 5. 5 Canvas vs. SVG • Canvas vs. SVG • Canvas • a well-known development model for games developers (low level drawing APIs) • hardware-accelerated by most of the recent browsers. • SVG, and its vectors-based technology • Better armed to scale across devices without loosing quality. • ViewBox property of SVG • Games assets-Scale from 3 to 80'' screens • Example game using both technologies. • SVG Racketball & Canvas Racquetball • Programming Simple Games Using Canvas or SVG
  • 6. 6 Performance of Canvas and SVG • 1000 small balls on screen • Using SVG: 1000 balls in SVG • Using Canvas: 1000 balls in Canvas • Environment • Intel i7-3770 with 8GB • Windows 7 (32bit) • Chrome 26
  • 7. 7 Performance of Canvas and SVG • Performance Comparison • Better for drawing a lot of objects on the screen • To achieve in video games
  • 8. 8 • Mixing both technologies • A first layer based on SVG to display the game menus • A second layer in background using a canvas for the game itself. • Some attentions to final performance results • Because the browsers & devices are far from being equals in this domain. • Don't forget that the main interest of HTML5 is to target all platforms.
  • 9. 9 • David Catuhe’s little brick breaker game • Using this composition principle • How to write a small game using HTML5 and JavaScript-BrikBrok • The first layer using SVG for the bricks to break • The background with a tunnel effect using the canvas tag. • Mimic this concept • The main game in background (hosting a plateformer or shoot'em up game, etc.) instead of the tunnel • first layer: the menus & configuration options in SVG.
  • 10. 10 Useful libraries & tools • Graphics • Physics Engine • Handling the multi touch events • Building connected games
  • 11. 11 Graphics • Writing the XML nodes of SVG manually or even playing with the low level APIs of Canvas • Be fun for a moment but not very productive. • Useful set of tools & libraries for building parts of HTML5 game. • Some SVG tools • InkScape: a free & open source desktop software • SVG Editor: an online software running directly inside your browser • Adobe Illustrator: Supports SVG as an export target, expensive. • Game assets (for menus or controls) • The Noun Project : free icons library • Open Clip Art Library: free SVG content
  • 12. 12 Graphics • Libraries (SVG) • RaphaelJS: SVG JavaScript library • Generating dynamic SVG with few lines of code. • Demo using for instance nonlinear animation functions on SVG elements, animated charts, etc. • HighCharts: charting • To display some players' stats • Those 2 libraries • Implement VML fallbacks for IE8 or older versions. • Target at least IE9 and above.
  • 13. 13 Graphics • Libraries (Canvas) • JavaScript InfoVis Toolkit: Charts using Canvas
  • 14. 14 Graphics • Libraries (3D) • ThreeJS: the usage of 3D in JavaScript • Be used to render some hardware-accelerated 3D via WebGL. • For a rendering inside the 2D canvas element of HTML5. • "CanvasRenderer examples" section • Used for instance to build our Galactic demo on the IE Test Drive. • Build 3D scenes working in all HTML5 browsers. • Note • Combine all of these graphics effects with the usage of: • CSS3 2D & 3D Transforms • Transitions • Animations • To stay focused on Canvas & SVG in this article.
  • 15. 15 Physics Engine • To do in a game • Displaying graphics • The AI (Artificial Intelligence): To bring life to your characters. • Code that alone and be creative • The physics & collisions: Box2D JS • Libraries • Box2D JS • with the various samples and you'll be amazed: • Tutorials series of Seth Ladd • Box2D orientation for the JavaScript developer • Used the Web Workers to compute the physics on the several available cores of your CPU. • An introduction on Web Workers APIs • Introduction to the HTML5 Web Workers: the JavaScript multithreading approach
  • 16. 16 Handling the multi touch events • Support touch for building a cross-devices game • 2 existing specifications around Touch Events • Pointer Events vs. Touch Events • Getting Touchy About Patents • Need to write code working fine inside IE10 & Windows 8 as well as with the implementation coming from the Apple devices. • Finger Painting: Sample demonstrating a possible pattern to support both kind of touch events • Handling Multi-touch and Mouse Input in All Browsers • Browser Surface: Demo for handling multi-touch inside IE10. • Need a recent IE10 version and a multitouch hardware running it.
  • 17. 17 Handling the multi touch events • Pointer.js • Boris Smus • The idea • To consolidate all types of touch (IE10, iOS like, mouse and pen) to simplify your developer life. • Generalized input on the cross-device web. • Current • A draft • No support yet the MSPointer* of IE10.
  • 18. 18 Building connected games • WebSockets • Build multiplayers games or a connected game to a server • W3C specification (and the underlying protocol handled by the IETF) • To support the widest possible number of users • Consider a fallback for browsers or devices which weren't supporting WebSockets yet or were supporting an older deprecated version. • 2 solutions • Socket.IO library for Node.js • SignalR working on top of IIS and ASP.NET • handle all the browsers & devices with their variety of support levels.
  • 19. 19 Some gaming frameworks • To build a 2D HTML5 game • 1 - Handling your sprites: splitting them into a sequence, animating them, effects, etc. • 2 - Handling your sounds & music (and this is not something easy in HTML5!) • 3 - Loading asynchronously your assets from the web server via a dedicated loader/assets manager • 4 - Building a collision engine, a high level logic for your game objects, etc. • 2 Way to build a 2d HTML5 game • Do that starting from scratch • Test & review what other brilliant developers have already done on the web.
  • 20. 20 Some gaming frameworks • The most well-known frameworks for building HTML5 2D games working inside all browsers: • MelonJS: A free framework that exposes a lot of useful services. • Works fine with the Tiled Map Editor tool. • CraftyJS • ImpactJS: a high quality well-known framework. It's not free but not too much expensive. • EaselJS: Written by an old flash developer. • Part of the CreateJS suite. • It's very complete, well documented and… free.
  • 21. 21 Some beginners' tutorials • Tutorials • porting an XNA C# game into HTML5/JavaScript thanks to EaselJS. • HTML5 Gaming: animating sprites in Canvas with EaselJS • HTML5 Gaming: building the core objects & handling collisions with EaselJS • HTML5 Platformer: the complete port of the XNA game to <canvas> with EaselJS • 3 others articles enhancing/extending the same game: • Tutorial: how to create HTML5 applications on Windows Phone thanks to PhoneGap • how to port the same game on Windows Phone thanks to PhoneGap/Cordova. • the same instructions for your Android or iOS device. • Modernizing your HTML5 Canvas games Part 1: hardware scaling & CSS3 • use CSS3 3D Transform, Transitions & Grid Layout to enhance the gaming experience • Modernizing your HTML5 Canvas games Part 2: Offline API, Drag'n'drop & File API • enable playing to the game in offline mode. • create your own levels and drag'n'drop them directly into the game.
  • 22. 22
  • 23. 23 • Tutorials on the EaselJS • a lot of simple demo to understand and great tutorials on the EaselJS website:http://www.createjs.com/#!/EaselJS • More generic tutorials on : • HTML5 Game Dev Tutorials • 10 cool HTML5 games and how to create your own • 2 more "advanced" articles • David Catuhe from Microsoft: • Unleash the power of HTML 5 Canvas for gaming. • Some optimization: Writing in the "demo scene". • The tips: Some ideas for HTML5 games. • Boris Smus from Google • Improving HTML5 Canvas Performance and it contains ton of good advices.
  • 24. 24 Some interesting online working games & experience feedbacks • Other cool examples on the web to share. • Be interesting to analyze how the developers made them. • Thanks to the magic of the web: right-click & "view source". • Be probably minified, • Can still learn a couple of interesting things by looking at the global architecture of the game. • Pirates Love Daisies written by Grant Skinner: • using the EaselJS framework.
  • 25. 25 • Windows 8 note • Windows 8 in the Windows Store • Pirates Love Daisies for Windows 8. • A HTML5 game working fine inside IE9 or IE10, building the Windows 8 version is almost only doing a simple copy… and paste • The game will then directly works inside the Metro experience. • To make a real good Windows 8 game • pay attention to the unique Windows 8 experience we're building. • Designing great games for Windows
  • 26. 26 • BKOM ROBOT GAME • Using EaselJS • Uses 3D sprites
  • 27. 27 • The 2 most currently famous HTML5 games • Angry Bird • Uses the Box2D library • Cut The Rope • a Windows 8 version of it in the Windows Store here: Cut The Rope for Windows 8
  • 28. 28 • To port into Windows 8. • 1 - Copy/Paste the Web version into a HTML5 Metro Style App project for Windows 8 • 2 - Add support for touch • 3 - Add support for the snapped view and pause the game • 4 - Build some High Resolution assets (1366x768 & 1920x1080) to propose the best experience for all the incoming Windows 8 tablets & PC. • The story around "Cut The Rope“ • a successful game written in Objective-C for the Apple iOS devices. • Ported into HTML5/Canvas and the developers who made this detail their feedback in this article: Cut The Rope - Behind the scenes • Experience feedback: Wooga's HTML5 Adventure • 40 more or less good HTML5 games • 40 Addictive Web Games Powered by HTML5 with some other available also here: HTML5games.com