CHAPTER 7

image

Creating a Stand-Alone 3-D Game

The arcade shooter we created in Chapter 6 is an example of a two-dimensional game. Sprites, labels, and even the scenes in a standard enchant.js game exist on a flat plane, as seen by the existence of only an x and y axis within the game. Although we can stack entities on top of each other, this is simply to manipulate visibility. There is no “depth” that can be controlled.

Enchant.js comes with a plug-in called gl.enchant.js, which enables three-dimensional games to be created. In this chapter, we explore how to use gl.enchant.js to create a 3-D version of the Whack-A-Mole game we created earlier. On ...

Get HTML5 Game Programming with enchant.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.