0%

Book Description

Build and Distribute Your Game Using an HTML5 Game Engine

As mobile hardware improves, HTML5 is gradually being used for gaming apps and a growing industry of game engines has begun to support it. HTML5 Game Engines: App Development and Distribution presents an introduction to development with HTML5 game engines as well as an in-depth look at popular engines. Along with downloadable example projects for each engine, the book provides techniques for packaging and distributing the final app to all the major platforms.

Get Hands-On Guidance through Practical Techniques and Examples

The book is divided into three parts. The first one covers the essentials of HTML5, discusses development strategies and techniques, and takes you through a basic pong game running in the browser with no dependencies. The second part implements four games using the Crafty, EaselJS, Impact, and Turbulenz game engines. In the third part, the author describes how several of these games are distributed on platforms, such as the Chrome Web Store, Apple iOS App Store, Google Play Store, and Facebook.

Table of Contents

  1. Preliminaries
  2. Dedication
  3. Preface
  4. How to Use This Book
  5. About the Author
  6. Acknowledgments
  7. I HTML5 Game Development
    1. Chapter 1 Introduction to HTML5
      1. 1.1 The HTML5 Standard
        1. 1.1.1 A Brief History of HTML
      2. 1.2 HTML5, the New Living Standard
      3. 1.3 HTML5 Stands Alone
      4. 1.4 Source Code
      5. 1.5 A Touch of Game Design
      6. 1.6 HTML5 Hello World Canvas
      7. 1.7 Pong Game Board
      8. 1.8 Pong Game Loop
      9. 1.9 Pong Game Refactoring
      10. 1.10 Summary
      11. Figure 1.1
        1. Figure 1.1
        2. Figure 1.2
        3. Figure 1.3
        4. Figure 1.4
      12. Listing 1.1
        1. Listing 1.1
        2. Listing 1.2
        3. Listing 1.3
        4. Listing 1.4
        5. Listing 1.5
        6. Listing 1.6
        7. Listing 1.7
    2. Chapter 2 HTML5 Development Strategies
      1. 2.1 Development Strategies
        1. 2.1.1 Progressive Enhancement and Graceful Degradation
        2. 2.1.2 Mobile-Focused Development
      2. 2.2 Browser Wars?
        1. 2.2.1 WebKit/Blink
        2. 2.2.2 Opera Mobile, Firefox Mobile, Windows Phone 8
        3. 2.2.3 Browser Detection versus Feature Detection
        4. 2.2.4 The Old Wrong Way
        5. 2.2.5 The Correct Way
      3. 2.3 HTML5 Sound and Music
        1. 2.3.1 HTML5 Audio Formats
      4. 2.4 Testing on Mobile Devices
        1. 2.4.1 WAMP/XAMPP for Windows
        2. 2.4.2 IIS for Windows
        3. 2.4.3 MAMP for Mac
      5. 2.5 Optimizing the Page for Mobile
        1. 2.5.1 Mobile Meta Tags
      6. 2.6 Chrome Developer Tools
      7. 2.7 Summary
      8. Figure 2.1
        1. Figure 2.1
        2. Figure 2.2
        3. Figure 2.3
        4. Figure 2.4
        5. Figure 2.5
        6. Figure 2.6
        7. Figure 2.7
        8. Figure 2.8
        9. Figure 2.9
        10. Figure 2.10
        11. Figure 2.11
        12. Figure 2.12
        13. Figure 2.13
      9. Table 2.1
        1. Table 2.1
      10. Listing 2.1
        1. Listing 2.1
        2. Listing 2.2
        3. Listing 2.3
  8. II HTML5 Game Engines
    1. Chapter 3 Crafty
      1. 3.1 Source Code
      2. 3.2 Introduction
      3. 3.3 Crafty Pong
        1. 3.3.1 Hello Crafty
        2. 3.3.2 From HTML5 Pong to Crafty Pong
      4. 3.4 HTML5 Game Graphics
        1. 3.4.1 HTML5 Audio JavaScript
        2. 3.4.2 Sprite Animation
      5. 3.5 Summary
      6. Figure 3.1
        1. Figure 3.1
        2. Figure 3.2
        3. Figure 3.3
        4. Figure 3.4
      7. Listing 3.1
        1. Listing 3.1
        2. Listing 3.2
        3. Listing 3.3
        4. Listing 3.4
        5. Listing 3.5
        6. Listing 3.6
    2. Chapter 4 EaselJS
      1. 4.1 Source Code
      2. 4.2 Introduction
      3. 4.3 Tic-Tac-Toe
      4. 4.4 Setup
      5. 4.5 Hello EaselJS
      6. 4.6 PreloadJS for EaselJS
      7. 4.7 EaselJS Sprites
      8. 4.8 Tic-Tac-Toe Implementation
      9. 4.9 Summary
      10. Figure 4.1
        1. Figure 4.1
        2. Figure 4.2
        3. Figure 4.3
        4. Figure 4.4
        5. Figure 4.5
      11. Listing 4.1
        1. Listing 4.1
        2. Listing 4.2
        3. Listing 4.3
        4. Listing 4.4
        5. Listing 4.5
        6. Listing 4.6
        7. Listing 4.7
        8. Listing 4.8
        9. Listing 4.9
        10. Listing 4.10
        11. Listing 4.11
        12. Listing 4.12
    3. Chapter 5 Impact
      1. 5.1 Source Code
      2. 5.2 Introduction
      3. 5.3 Setup
        1. 5.3.1 PHP Web Server
        2. 5.3.2 Impact Project Structure
      4. 5.4 Hello Impact
      5. 5.5 MechaJet Implementation
        1. 5.5.1 Tile Map, Collision Map
        2. 5.5.2 Entities
        3. 5.5.3 Buzzard Entity
        4. 5.5.4 Bomb Entity
        5. 5.5.5 Corridor Entity
      6. 5.6 Weltmeister
      7. 5.7 main.js
      8. 5.8 Player Entity
      9. 5.9 Level 2
      10. 5.10 Summary
      11. Figure 5.1
        1. Figure 5.1
        2. Figure 5.2
        3. Figure 5.3
        4. Figure 5.4
        5. Figure 5.5
        6. Figure 5.6
        7. Figure 5.7
        8. Figure 5.8
        9. Figure 5.9
        10. Figure 5.10
        11. Figure 5.11
      12. Listing 5.1
        1. Listing 5.1
        2. Listing 5.2
        3. Listing 5.3
        4. Listing 5.4
        5. Listing 5.5
        6. Listing 5.6
        7. Listing 5.7
        8. Listing 5.8
        9. Listing 5.9
        10. Listing 5.10
        11. Listing 5.11
        12. Listing 5.12
        13. Listing 5.13
    4. Chapter 6 Turbulenz
      1. 6.1 Source Code
      2. 6.2 Introduction
      3. 6.3 WebGL
      4. 6.4 Installation
        1. 6.4.1 Official Installer
        2. 6.4.2 Protolib
      5. 6.5 From Source
      6. 6.6 Hello Turbulenz App
      7. 6.7 Turbulenz Game Structure
      8. 6.8 Sky Marble Implementation
        1. 6.8.1 Init Function
        2. 6.8.2 dropBrick/dropMarble/updateTorus Functions
        3. 6.8.3 Update Function
      9. 6.9 Other Turbulenz Tips
        1. 6.9.1 Debugging
        2. 6.9.2 Templates
      10. 6.10 Summary
      11. Figure 6.1
        1. Figure 6.1
        2. Figure 6.2
        3. Figure 6.3
        4. Figure 6.4
      12. Listing 6.1
        1. Listing 6.1
        2. Listing 6.2
  9. III HTML5 App Distribution
    1. Chapter 7 Chrome Web Store
      1. 7.1 Source Code
      2. 7.2 Introduction
      3. 7.3 Chrome Web Store
      4. 7.4 From Web App to Chrome App
        1. 7.4.1 Getting Started
        2. 7.4.2 App Development
      5. 7.5 Summary
      6. Listing 7.1
        1. Listing 7.1
        2. Listing 7.2
    2. Chapter 8 Apple iOS App Store
      1. 8.1 Source Code
      2. 8.2 Introduction
      3. 8.3 Device Provisioning
      4. 8.4 Ejecta
        1. 8.4.1 Setup
      5. 8.5 More Notes
        1. 8.5.1 Ejecta Audio
      6. 8.6 Preparing for the App Store
        1. 8.6.1 Distribution
        2. 8.6.2 iTunes Connect
      7. 8.7 Summary
      8. Figure 8.1
        1. Figure 8.1
        2. Figure 8.2
        3. Figure 8.3
        4. Figure 8.4
        5. Figure 8.5
        6. Figure 8.6
        7. Figure 8.7
        8. Figure 8.8
        9. Figure 8.9
        10. Figure 8.10
        11. Figure 8.11
      9. Listing 8.1
        1. Listing 8.1
    3. Chapter 9 Google Play Store
      1. 9.1 Source Code
      2. 9.2 Introduction
      3. 9.3 CocoonJS
        1. 9.3.1 Setup
        2. 9.3.2 MechaJet on CocoonJS
        3. 9.3.3 Generating an APK (Android Package Kit)
        4. 9.3.4 Distribution
        5. 9.3.5 Signing the APK
      4. 9.4 Summary
      5. Figure 9.1
        1. Figure 9.1
        2. Figure 9.2
      6. Listing 9.1
        1. Listing 9.1
    4. Chapter 10 Facebook App
      1. 10.1 Source Code
      2. 10.2 Introduction
      3. 10.3 Setup
      4. 10.4 App Registration
        1. 10.4.1 Heroku Setup
      5. 10.5 Tic-Tac-Toe on Facebook
      6. 10.6 Summary
      7. Figure 10.1
        1. Figure 10.1
        2. Figure 10.2
        3. Figure 10.3
        4. Figure 10.4
        5. Figure 10.5
        6. Figure 10.6
        7. Figure 10.7
        8. Figure 10.8
        9. Figure 10.9
        10. Figure 10.10
      8. Listing 10.1
        1. Listing 10.1
    5. Chapter 11 Windows and Mac Native
      1. 11.1 Source Code
      2. 11.2 Introduction
      3. 11.3 node-webkit
        1. 11.3.1 node-webkit Game Package
      4. 11.4 Windows Distribution
        1. 11.4.1 Resource Editing
        2. 11.4.2 Enigma Virtual Box Alternative
        3. 11.4.3 Windows Installer
      5. 11.5 Mac Distribution
        1. 11.5.1 node-webkit.app
        2. 11.5.2 DMG File
      6. 11.6 Summary
      7. Figure 11.1
        1. Figure 11.1
        2. Figure 11.2
        3. Figure 11.3
      8. Listing 11.1
        1. Listing 11.1
        2. Listing 11.2
    6. Chapter 12 Final Notes
      1. 12.1 Plugins
        1. 12.1.1 Crafty Modules
        2. 12.1.2 Impact Plugins
        3. 12.1.3 CocoonJS Extensions
      2. 12.2 Desktop Stores
      3. 12.3 Monetization
      4. 12.4 Signing Off
  10. Tools Appendix
  11. Bibliography