Skip to content

tritris

Parodper edited this page Mar 30, 2019 · 3 revisions

TRITRIS Program

This is a implementation of tetris with 3 block pieces instead of 4.

To know the horizontal and vertical coordinates of a cell subtract 16 from the number 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.

Like this:

Cell = (X - 1) + (Y - 1)*16

Variables

  • 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 1 second faster

  • X, Y: Loop variables

  • Z: Number of cells

  • Z[]: Cells

Gotos

  • 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

Pieces

Piece 1

 0
 0
 0

Piece 2

 000

Piece 3

 0
 00

Piece 4

 00
 0

Piece 5

  0
 00

Piece 6

 00
  0
Clone this wiki locally