- 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.
推薦閱讀
- 數據浪潮
- LibGDX Game Development Essentials
- Architects of Intelligence
- Learning JavaScriptMVC
- 數據架構與商業智能
- 企業級數據與AI項目成功之道
- 網站數據庫技術
- 深入淺出 Hyperscan:高性能正則表達式算法原理與設計
- Instant Autodesk AutoCAD 2014 Customization with .NET
- 新手學會計(2013-2014實戰升級版)
- 貫通SQL Server 2008數據庫系統開發
- 改進的群智能算法及其應用
- Spring Boot 2.0 Cookbook(Second Edition)
- 智能與數據重構世界
- Practical Convolutional Neural Networks