-
Notifications
You must be signed in to change notification settings - Fork 0
tritris
This is a implementation of tetris with 3 block pieces.
To know the horizontal and vertical coordinates of a cell subtract 16 from the memory location until it's below 16. The number you got its the x coordinates and the number of times you substrated 16 its the y coordenates. The formulae to convert between memory location and coordinates is:
Cell = (X - 1) + (Y - 1)*16
-
A: Vertical coordinate for block 1
-
B: Horizontal coordinate for block 1
-
E: Vertical coordinate for block 2
-
F: Horizontal coordinate for block 2
-
G: Vertical coordinate for block 3
-
H: Horizontal coordinate for block 3
-
C: Piece
-
D: Points
-
I: Key pressed
-
K: Flag for ignoring input to move the piece faster
-
X, Y: Loop variables
-
Z: Number of cells
-
Z[]: Cells
- 0: Get block positions for the piece
- 1: Key handler
- 2: Checks if the piece has reached the bottom or collided with another piece. If yes it saves the blocks to memory and deletes a line if its full.
- 3: Ends the program
0
0
0
Can change to piece 2
000
Can change to piece 1
0
00
Can change to piece 5
00
0
Can change to piece 6
0
00
Can change to piece 3
00
0
Can change to piece 4