- XNA 4.0 Game Development by Example Beginner's Guide(Visual Basic Edition)
- Kurt Jaegers
- 147字
- 2021-08-20 15:50:43
Time for action – updating Game1 to update animated pieces
- Modify the
Update()
method of theGame1
class by replacing the current case statement for theGameState.Playing
state with the following:Case GameStates.Playing timeSinceLastInput += (CSng(gameTime.ElapsedGameTime.TotalSeconds)) If _gameBoard.ArePiecesAnimating() Then _gameBoard.UpdateAnimatedPieces() Else _gameBoard.ResetWater() Dim y As Integer For y = 0 To GameBoard.GameBoardHeight CheckScoringChain(_gameBoard.GetWaterChain(y)) Next _gameBoard.GenerateNewPieces(True) If (timeSinceLastInput >= MinTimeSinceLastInput) Then HandleMouseInput(Mouse.GetState()) End If End If
What just happened?
This method is very similar to its previous incarnation. In this instance, we check to see if there are outstanding animated pieces to process. If there are, then UpdateAnimatedPieces()
will run. If no animated pieces currently exist, the previous behavior of the GameStates.Playing
case is executed.
推薦閱讀
- 醫療大數據挖掘與可視化
- 數據要素五論:信息、權屬、價值、安全、交易
- Enterprise Integration with WSO2 ESB
- INSTANT Cytoscape Complex Network Analysis How-to
- 數據庫原理與應用(Oracle版)
- 企業級數據與AI項目成功之道
- Hands-On Mathematics for Deep Learning
- Apache Kylin權威指南
- Instant Autodesk AutoCAD 2014 Customization with .NET
- 編寫有效用例
- 從實踐中學習sqlmap數據庫注入測試
- 大數據數學基礎(R語言描述)
- Oracle 11g+ASP.NET數據庫系統開發案例教程
- Access 2016數據庫應用基礎
- 大數據隱私保護技術與治理機制研究