Download presentation
Presentation is loading. Please wait.
1
Game Specific Options (Pre-Initialized) Board Size? Starting Position? Allow Diagonal moves or wins? Etc… Play Game (Initialized) Player is computer/human? Who goes first? Player Names And of course actually playing the game Start Specific Game End Specific Game Top Level GUI States
2
Initialization/De-initialization Start Specific Game Initialize core GUI Buttons for changing player names, whether a player is computer or human, etc… Initialize Game Specific Game Board Create board pieces, set board size, add bindings, etc… ANIMATION!!! End Specific Game De-Initialize core GUI Disables buttons, possibly shrinks or destroys windows De-Initialize Game Specific Game Board Return board to empty state prior to initialization
3
Play Game State Game Specific Options (Pre-Initialized) Board Size? Starting Position? Allow Diagonal moves or wins? Etc… Play Game (Initialized) Player is computer/human? Who goes first? Player Names And of course actually playing the game Start Specific Game End Specific Game
4
Play Game State (cont) 1: No Game Initialized Yet Game board exists, but no game has been run Board appears as is after Game Specific Initialize Three Substates 2: Mid Game Game has been started but is not over Pieces and board exist, and moves are shown 3: End Game Game has ended. Pieces and board exist, but moves are not shown. Game Specific end game animation may have occurred
5
From State to State 1: No Game Started2: Mid Game 3: End Game 2: Mid Game1: No Game Started3: End Game
6
State 1 1: No Game Started 2: Mid Game or 3: End Game New Game (button) Setup Set Up Global Variables and Prepare for New Game Clear board Return the board to a predetermined state Game Specific! Draw board Draws the new Game board given the initial position Driver Loop This loop drives the game until a human player’s turn is at hand
7
Driver Loop Game Over Game Specific Game Over Sequence Primitive position? 3: End Game Player is human? Show Moves Given the move type, current position, and move list with values and remoteness Shows the moves appropriately based on move-type 2: Mid Game Player is computer? Get move from database Update Globals Handle Move Game animates move Board is visually set up to match the new-position
8
State 2 2: Mid Game 2: Mid Game or 3: End Game New Game (button) Setup Set Up Global Variables and Prepare for New Game Clear board Return the board to a predetermined state Game Specific! Draw board Draws the new Game board given the initial position Driver Loop This loop drives the game until a human player’s turn is at hand Hide Visible Moves Handle Move Game animates move Board is visually set up to match the new-position Get Human Move Obtain the user move by interaction with the game board
9
State 2 (cont) and State 3 2: Mid Game Undo move Graphically undoes the move Determine which type of undo is necessary Show Moves Driver Loop This loop drives the game until a human player’s turn is at hand Hide Moves Game Over Sequence Cleanup Allows the “reversal” of a Game Over Sequence so the last position is re- displayed 3: End Game Undo (button)
10
Showing Moves All Moves (button) Value Moves (button) Best Moves (button) Switch the currently shown moves to selected
11
Overview 2: Mid Game New Game (button) SetupClear boardDraw board Driver Loop Hide Visible Moves Handle Move Get Human Move 1: No Game Started 3: End Game Undo move Which Undo? Undo (button) Game Over Sequence Cleanup Show Moves
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.