Time for action – updating GameBoard to support animatedpieces
- In the declarations section of the GameBoard class, add three dictionaries:
public Dictionary<string, FallingPiece> fallingPieces = new Dictionary<string, FallingPiece>(); public Dictionary<string, RotatingPiece> rotatingPieces = new Dictionary<string, RotatingPiece>(); public Dictionary<string, FadingPiece> fadingPieces = new Dictionary<string, FadingPiece>();
- Add methods to the GameBoard class to create new falling piece entries in the dictionaries:
public void AddFallingPiece(int X, int Y, string PieceName, int VerticalOffset) { fallingPieces[X.ToString() + "_" + Y.ToString()] = new FallingPiece(PieceName, VerticalOffset); } public void AddRotatingPiece(int X, int Y, string PieceName, ...
Get XNA 4.0 Game Development by Example Beginner's Guide 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.