SlideShare una empresa de Scribd logo
1 de 28
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

Más contenido relacionado

Similar a W3C HTML5 KIG-The complete guide to building html5 games

Html5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsHtml5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsEngin Hatay
 
Delta Engine @ CeBit 2011
Delta Engine @ CeBit 2011Delta Engine @ CeBit 2011
Delta Engine @ CeBit 2011Karsten Wysk
 
Html5 Game Development with Canvas
Html5 Game Development with CanvasHtml5 Game Development with Canvas
Html5 Game Development with CanvasPham Huy Tung
 
Programming Language Final PPT
Programming Language Final PPTProgramming Language Final PPT
Programming Language Final PPTMatthew Chang
 
Introduction to WebGL - 1st WebGL meetup Amsterdam
Introduction to WebGL - 1st WebGL meetup AmsterdamIntroduction to WebGL - 1st WebGL meetup Amsterdam
Introduction to WebGL - 1st WebGL meetup AmsterdamThreeDee Media
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularTodd Anglin
 
HTML5 Games Status and issues
HTML5 Games Status and issuesHTML5 Games Status and issues
HTML5 Games Status and issuesJ.h. Liu
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...Radu Vunvulea
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureMarco Parenzan
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Conference
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQueryPaul Bakaus
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesPooya Eimandar
 
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...DevClub_lv
 
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3DJS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3DJSFestUA
 
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentationAmsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentationThreeDee Media
 

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

Html5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsHtml5 Canvas and Mobile Graphics
Html5 Canvas and Mobile Graphics
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
Delta Engine @ CeBit 2011
Delta Engine @ CeBit 2011Delta Engine @ CeBit 2011
Delta Engine @ CeBit 2011
 
Html5 Game Development with Canvas
Html5 Game Development with CanvasHtml5 Game Development with Canvas
Html5 Game Development with Canvas
 
Programming Language Final PPT
Programming Language Final PPTProgramming Language Final PPT
Programming Language Final PPT
 
Html5 (games)
Html5 (games)Html5 (games)
Html5 (games)
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Introduction to WebGL - 1st WebGL meetup Amsterdam
Introduction to WebGL - 1st WebGL meetup AmsterdamIntroduction to WebGL - 1st WebGL meetup Amsterdam
Introduction to WebGL - 1st WebGL meetup Amsterdam
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
 
HTML5 Games Status and issues
HTML5 Games Status and issuesHTML5 Games Status and issues
HTML5 Games Status and issues
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Write retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with AzureWrite retrogames in the web and add something more with Azure
Write retrogames in the web and add something more with Azure
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game Engines
 
Cross-Platform Development
Cross-Platform DevelopmentCross-Platform Development
Cross-Platform Development
 
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
 
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3DJS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
 
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentationAmsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
 

Más de Changhwan Yi

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

Más de Changhwan Yi (15)

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

Último

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Último (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

W3C HTML5 KIG-The complete guide to building html5 games

  • 1. THE COMPLETE GUIDE TO BUILDING HTML5 GAMES 2013.4.17 동국대학교 이창환 • yich@dongguk.edu • 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