Designing the Blocks

With the code for the player now implemented, you are probably anxious to get it into the game engine and make your player move around the level and play the game. Don't get too far ahead of yourself yet, though: you haven't even designed the level object or the requirements for the level object, namely the blocks that compose the levels. You should design these blocks now. First, add a new code file to your project called block.cs and then add the initial class implementation in Listing 7.8.

Listing 7.8. The Initial Block Implementation
 public class Block { private const float BoxSize = 3.0f; // World size of box // List of colors available for boxes private static readonly Color[] BoxColors = {Color.Red , Color.Blue, Color.Green, ...

Get Beginning 3D Game Programming 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.