Building 2D HTML5 games has myths and realities. While HTML5 allows "write once, run everywhere", debugging and plugins are still issues. HTML5 includes Canvas, Web Audio API, and others. Canvas is GPU accelerated on modern browsers/devices, achieving 30-50 FPS with 500 sprites. JavaScript performance varies significantly between browsers and devices. Sound support varies by browser and format. Developing for a variety of screen sizes and orientations poses challenges. Overall, HTML5 is viable for 2D games on popular mobile browsers if the game is not too complex and graphics-intensive.
16. Implicit Texture Loading
void drawImage( in nsIDOMElement image,
in float sx,
in float sy,
in float sw,
in float sh,
in float dx,
in float dy,
in float dw,
in float dh );
35. Full Screen
•Proper
• Full screen API (requestFullscreen)
•Hack
• scrollTo
• Zynga Scroller to handle the tricks
• minimal-ui
• iPhone on iOS 7.1+ only
52. • Easy and common:
• Add logo + splash (PNG/JPG)
• Add animated preloader (HTML+JS)
• Submit scores
• Submit start/gameover/levelend/etc
• Work in iframe, custom resize
• Harder and rare:
• Work in “their” API canvas
• Custom path to load resources (CDN)
54. Dreaded WebView
• iOS:
• No JIT in WebView
• Canvas is likely not hardware accelerated
• Hint: test on Chrome for iOS
• Android:
• Based on standard Android Browser
before 4.4
• Canvas is NOT hardware accelerated