- 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
推薦閱讀
- Developing Mobile Games with Moai SDK
- 大數(shù)據(jù)導(dǎo)論
- Access 2016數(shù)據(jù)庫技術(shù)及應(yīng)用
- Creating Dynamic UIs with Android Fragments(Second Edition)
- Remote Usability Testing
- 數(shù)字媒體交互設(shè)計(初級):Web產(chǎn)品交互設(shè)計方法與案例
- 信息學(xué)競賽寶典:數(shù)據(jù)結(jié)構(gòu)基礎(chǔ)
- 云數(shù)據(jù)中心網(wǎng)絡(luò)與SDN:技術(shù)架構(gòu)與實現(xiàn)
- Construct 2 Game Development by Example
- 大數(shù)據(jù)分析:數(shù)據(jù)倉庫項目實戰(zhàn)
- Mastering LOB Development for Silverlight 5:A Case Study in Action
- Web Services Testing with soapUI
- R Machine Learning Essentials
- 云計算寶典:技術(shù)與實踐
- 大數(shù)據(jù)時代系列(套裝9冊)