HTML and CSS Reference
Listing 9.27. run.js—Polygon generator
Polygons will now generate after you press X on a keyboard for the first time. If you shoot
them, they'll fire an error because the game tries to use nonexistent entity templates for
cubes and particles. You'll set up those with the next set of tasks:
• Group 3—Generating particles
◦ Step 1: Create a 3D cube particle.
◦ Step 2: Add color, rotation, and index data for cubes.
◦ Step 3: Add size, type, and other cube metadata.
◦ Step 4: Generate square particles.
Issues with requestAnimationFrame() and other timers