Contents
Chapter 1: JavaScript Is Not the Language You Think It Is
JavaScript Typing and Equality
Inheritance the JavaScript Way
Chapter 2: Optimal Asset Loading
Using a Content Distribution Network
Chapter 3: High-Performance JavaScript
Updating Only What’s Important
Warming Up the Virtual Machine
Your Code Will Be Compiled and Optimized on the Fly
Chapter 4: Efficient JavaScript Data Structures
The Importance of Data Structures
ArrayBuffers and ArrayBufferViews
Complex Structures as Single ArrayBufferViews
Chapter 5: Faster Canvas Picking
Basic Picking with Bounding Boxes
Doing Picking Against the Convex Hull
Chapter 7: Importing Flash Assets
Chapter 8: Applying Old-School Video Game Techniques in Modern Web Games
Displaying Animations in Extremely Large Viewports
Chapter 9: Optimizing WebGL Usage
Chapter 10: Playing Around with the Gamepad API
Chapter 11: Introduction to WebSockets for Game Developers
Setting Up a WebSocket Connection
Reducing the Size of Data Transmitted
Intelligently Processing and Distributing Packets
Autonomous Clients/Echo Server
Dumb Clients/Authoritative Server
Off-the-Shelf Solutions and WebSocket-likeProducts
Chapter 12: Real-Time Multiplayer Network Programming
Communication Between the Server and Client
Chapter 13: The State of Responsive Design
Understanding the Problem at Hand
Working with a Cloud Computing Resource
Chapter 14: Making a Multiplatform Game
Chapter 15: Developing Better Than Native Games
Losing Fullscreen and How to Handle It
Staying Sharp Using Less Pixels
Chapter 16: Mobile Web Game Techniques with Canvas 2D API
Bitmap Images and Vector Images
In-Memory Canvas (Offscreen Canvas)
Keeping Canvas Applications Stable
Chapter 17: Faster Map Rendering
Fetch the Data from the Server
Understanding the Data Format to Render
Fast Canvas Rendering with Precaching
Chapter 18: HTML5 Games in C++ with Emscripten
Third-Party Dependencies and a Real Build System
Integrating with OpenGL, Attempt #1: Regal
Integrating with OpenGL, Attempt #2: Simplifying the AstroMenace Renderer
Chapter 19: Introduction to TypeScript: Building a Rogue-like Engine
Chapter 20: Implementing a Main Loop in Dart
Your First Main Loop and What’s Wrong with It
Chapter 21: Saving Bandwidth and Memory with WebGL and Crunch
Chapter 22: Creating a Two-Dimensional Map Editor
Map Field and Its Serialization to JSON
Chapter 23: Automating Your Workflow with Node.js and Grunt
What Should Your Build Script Do?
Chapter 24: Building a Game with the Cocos2d-html5 Library
What Makes Cocos2d the Best Choice for Your 2D Game Development?
What Sets Cocos2d Apart from Other Similar Frameworks?
Why Was Cocos2d-html5 Created?
What Are the Main Differences in Cocos2d and Cocos2d-html5?
Extending the Power of Cocos2d-html5 with Cocos2d JavaScript Binding
Introduction to the Directory Structure
Introduction to the Tiled Editor
Getting Started on Built-in Examples
Setting Up Your First “Hello World” Project
Building the Tower Defence Game
The Tower Defence Gameplay Scene
Designing the Required Game Components
A Step-by-Step Process for Making the Tower Defence Game
Releasing a Cocos2d-html5 App to a Native App
The Power of Distributing an HTML5 Game as a Native Package
Setting Up the Cocos2d JSB Environment
Adding Resources to the Project