HTML and CSS Reference
As you understand how to create entities, you'll learn about 3D modeling and efficient
OOP programming. If you don't have any knowledge about creating 3D shapes or entity
management, don't worry; we'll guide you along the way.
Prereqs: play the game, grab the code, and test your engine
If you haven't done so already, head over to http://html5inaction.com/app/ch9/ and play
the game. And make sure you pick up the game's files from http://www.manning.com/
crowther2/ by downloading HTML5 in Action 's source files.
The work in this section is bundled into three groups of steps:
Group 1—Making your player
Group 2—Outputting enemies
Group 3—Generating particles
• Step 1: Create a 3D polygon
• Step 2: Create a complex
• Step 3: Generate random en-
• Step 4: Resolve enemy col-
• Step 5: Spawn enemies in a
• Step 1: Capture user input.
• Step 2: Program the heads-
• Step 3: Create the 2D player
• Step 4: Animate the player
• Step 5: Create the player's
• Step 1: Create a 3D cube
• Step 2: Add color, rotation,
and index data for cubes.
• Step 3: Add size, type, and
other cube metadata.
• Step 4: Generate square
Let's dive in to the first group and make your player.
9.3.1. Creating a game interface and control objects