Sprint #2 - Daily Scrum #04
Product: Tetris2P AI
Sprint Summary
Daily Objectives
- Figure out game structure and create main menu scenee
Notes
First things first, lets draw a mockup or the game client
What VIew’s/Game Modes/Screens do we need (in the context of adding buttons to the screen/UI)
- Sprint Mode
- VS Random Opponent
- VS AI
- Create Lobby(?)
- Join Lobby
- Settings
THIS IS IMPORTANT UI WORK OK; Main Menu Buttons:
- Marathon/Practice
- Secondary game menu(?)
- restart
- Exit to main menu
- Play AI
- settings
- Quickplay
- Random matchmaking
- Eventually can include account and mmr if i wanted to
- Save mmr using cookies or something
- Create Lobby
- join lobby using url
- Settings
- controls/speed/ui customization/etc
- control global setting variables
- Secondary game menu(?)
UI SHOULD NOT BE AN ISSUE RN
- Issue is having similar menus for different UI’s
- I’m really into Top-Down approach apparently
Ok we’re going to uh:
- During gameplay always show the two tetris ‘instances’
- Leave second one blank, if single player mode
- If lobby and no second player yet:
- Display invite code on empty tetris instance
- In lobby with second player:
- Display name on second tetris instance, also maybe ready status
- In lobby:
- Ready Up button/status
- Spectate or Join game button
- During Game/In Lobby: Press ESCAPE to show menu:
- Leave to Main Menu Button
- Settings button or button settings
OK ENOUGH WITH THE HECKING UI AND BUTTON WORK: Let’s talk game and game Pieces
- Tetris Game Instance (2x)
- Held Piece
- Piece Queue
- Will be moved to match instance object instead later
- Game Grid
- Current Tetriminos
- Lines Sent
- KO’s
- Game Timer
- Tetrominos (parent class for all tetrominos, make subclass for each type)
- Anchor Position
- Tetromino Type/Shape
- Current Orientation
- Orientation Number
- Orientation Dictionary
- Tetris Match Instance
- Tetris Game Instance (2x)
- Piece Queue
- This is to make sure both instances have the same queues
- Match Timer
So App Instance > Tetris Match Instance > Tetris Game Instance > Tetrimono Instance Game Instance update function (delta passed as parameter):
- Check if time to drop piece in this update
- If piece, can’t drop further:
- Lock piece to stack
- UpdateGameState() // defined below
- break()
- If piece, can’t drop further:
- If update function continues:
- Process input(s):
- need to check for short presses and long presses
- Perform action on short press
- Perform long press action on set intervals
- Applies to both rotating and moving pieces
- If hold piece:
- Update held tetromino piece
- spawnNewTetromino()
- Process input(s):
UpdateGameState() //occurs after a piece is locked
- Update cells in game grid based on locked piece
- If line cleared:
- Clear row(s) in grid
- Shift other rows downward
- Calculate combo streak
- If no line cleared:
- Add Trash Lines
- Check if ToppedOut
- Either EndGame() or addKO(), removeTrash()
- spawnNewTetromino():
- If unable to:
- Either EndGame() or addKO(), removeTrash()
- If unable to:
oh HECK how do you do animations with html5 canvas
Should I process input first or not; probably do drop first
Uh make sure to remember, to check game stuff based on the Match Timer and not a time elapsed function
Make general purpose function for checking if a piece is touching a floor
- Can use same function for creating ghost
Only need to check game state when game state changes: - GameState only changes when a piece is dropped
- Trash Lines will only appear if a piece has dropped Incorporate ‘Scenes’ and ‘GameStates’
- Scenes:
- MainMenu heck im already stressed again Create separate files for scenes and objects
- MainMenuScene
- SinglePlayerScene
- LobbyScene Main.js starts the actual game, creates the actual game and canvas
- Main.js handles the update loop and is the object for the actual game/screen
- Main.js handles switching between Scene Objects
- Main.js handles all the global variables and settings
- MAIN.JS IS THE GAME CLIENT
Objectives Completed
-
Mapped out the game navigation and corresponding buttons for each scene
-
Fleshed out necessary gameObjects again
-
Created and detailed pseudocode for the actual game logic