December 2004
Beginner
432 pages
10h 17m
English
Before you can start implementing the level, you need to add a new code file to your project to hold the level's code. You can call this file level.cs and add it to your project now. The initial implementation of your level class appears in Listing 8.1.
public class Level { private const float Spacing = 3.35f; private const int SquareSize = 13; private const float StartingLocation = (Spacing * SquareSize) / 2.0f; // The list of blocks that comprise the level private Block[] blocks = null; // The final color to win private BlockColor finalColor; // Store the player private Player currentPlayer = null; // Block index of the player private int playerIndex; // Total number of moves made so far ... |
Read now
Unlock full access