Build your own 2D Game Engine

The following are the source code to the examples of the book: Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Click on the links to run the corresponding exmples.

It is recommended that you run the following examples with a Google Chrome Web Browser.

Known problems with other browsers:
  • Microsoft Internet Explorer 11 does not support HTML5 AudioContext and thus will not execute any projects after Chapter 4.
  • Mozilla Firefox (version 39.0) does not support some of the GLSL shaders in Chapter 9.

Useful links

Other Relevant links

Chapter 1: Introduction

Chapter 2: Working with HTML5 and WebGL

Chapter 3: Drawing objects in the World

Chapter 4: Implementing Common Components of Video Games

Chapter 5: Working with Textures, Sprites, and Fonts

Chapter 6: Defining Behaviors and Detecting Collisions

Chapter 7: Manipulating the Camera

Chapter 8: Implementing Illumination and Shadow

Chapter 9: Integrating Physics and Particles

Chapter 10: Supporting Camera Background

Chapter 11: Building a Simple Game: From Design to Completion