-
Notifications
You must be signed in to change notification settings - Fork 5
Game Structure
oliverlevy110 edited this page Jan 17, 2020
·
4 revisions
- Background: The sprite that contains the background image.
- Directional Light:
- Camera: The viewport the player looks out from.
- Matrix (MeshInstance)(Children: Gridmap, Position3D, DropTrail): This is the game board. It contains a GridMap.
- Position3D: origin of falling pieces.
- Hold (MeshInstance): A
- Scene to hold pause text. Can change UI controls in this scene.
- The available keyboard-controls are coded in res://controls.gd
- MeshInstance: MeshInstance is a node that takes a Mesh resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single Mesh in many places.
- Game pieces are held in J/I/O/L/N/T/S/Z .tscn file. Game blocks are rectangular meshes. Color is set by emission color (in properties).
- Structure of a piece: Each piece is made of four instanced Minos. Mino is a scene in itself. Mino has the scene Minomesh, which controls all of the visual properties of the blocks. Piece(L)->Mino->MinoMesh.
- The primary code containing all the methods that can be called on a piece are contained in __Tetromino.gd
- Main:
- GridMap (Board):
- Tetrominos: Contains all the functions to manipulate a piece. Called in GridMap and Main.
- Tetro(I/J/N/O/S/T/Z): Contains rotating instructions to override the instructions in Tetrominos.