HTML and CSS Reference
In-Depth Information
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 and play
the game. And make sure you pick up the game's files from
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
3D model.
• Step 3: Generate random en-
emy properties.
• Step 4: Resolve enemy col-
• Step 5: Spawn enemies in a
controlled manner.
• Step 1: Capture user input.
• Step 2: Program the heads-
up display.
• 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
The first thing we'll focus on is setting up the intro screen's non-3D logic, the result of
which appears in figure 9.8 .
Search WWH ::

Custom Search