- XNA 4.0 Game Development by Example Beginner's Guide(Visual Basic Edition)
- Kurt Jaegers
- 153字
- 2021-08-20 15:50:38
The GameBoard class
Now that we have a way to represent pieces in memory, the next logical step is to create a way to represent an entire board of playing pieces.
The game board is a two-dimensional array of GamePiece
objects, and we can build in some additional functionality to allow our code to interact with pieces on the game board by their X
and Y
coordinates.
- Store a
GamePiece
object for each square on the game board - Provide methods for code using the
GameBoard
to update individual pieces, by passing calls through to the underlyingGamePiece
instances - Randomly assign a piece type to a
GamePiece
- Set and clear the "Filled with water" flags on individual
GamePieces
- Determine which pipes should be filled with water, based on their position and orientation, and mark them as filled
- Return lists of potentially scoring water chains to code using the
GameBoard
推薦閱讀
- 同步:秩序如何從混沌中涌現
- PyTorch深度學習實戰:從新手小白到數據科學家
- 從0到1:數據分析師養成寶典
- 數據庫開發實踐案例
- 3D計算機視覺:原理、算法及應用
- 大數據治理與安全:從理論到開源實踐
- Google Cloud Platform for Developers
- Mastering LOB Development for Silverlight 5:A Case Study in Action
- 從實踐中學習sqlmap數據庫注入測試
- Oracle 11g+ASP.NET數據庫系統開發案例教程
- 中國云存儲發展報告
- Oracle 內核技術揭密
- MySQL性能調優與架構設計
- 數據時代的品牌智造
- 大數據網絡傳播模型和算法