Please enable JavaScript.
Coggle requires JavaScript to display documents.
Tetris, Don't understand, No need?, Hold piece - Coggle Diagram
Tetris
-
Game Architecture
-
tetris_logic
-
No figures are being drawn on the tetris board. The drawing part has nothing to do with the game logic.
-
-
-
-
Game architecture examples, websites and info
MVC
-
Model
-
BrickViewModel Class
-
-
informations about each individual brick: row, column and the color name
contains all information needed by the View to render the game board, the score board and to know whether the game is over or not
View
The view really contains no business logic (in our case, no game logic). Here we can see its basic goals:
Set up a timer, which calls the Controller every 200 milliseconds to get a ViewModel containing an updated game board snapshot (serialized as JSON).
Parse the returned JSON to render the board, score, high score, level and next piece.
Set up another timer that calls the Controller every 1000 milliseconds to request a new movement for the falling pieces.
Listen to the keyboard events, and calls the Controller to start a new game, to pause of resume the game, to move or rotate the falling piece, or to restart the game.
Controller
As we can see below, the Controller is even dumber than the View. Its goal is merely to expose actions that are consumed/called by the view, call the hard-working method on the GameManager side, and return (or not) a JSON-serialized ViewModel.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Don't understand
-
-
-
-
Mini T-spin
when one of the minoes next to pointing side is empty, or holes were made without using the triple kick
-
-
-