Package tetris.model
Class Figure
java.lang.Object
tetris.model.Figure
The class Figure implements a figure of the Tetris game.
- Version:
- 2.1
- Author:
- Stephan Fischli
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
blocks
The blocks of the figure.
-
-
Constructor Details
-
Figure
public Figure()
-
-
Method Details
-
getBlocks
Gets the blocks of the figure.- Returns:
- the blocks of the figure
-
shift
public void shift(int dx, int dy) Shifts the figure in the specified direction.- Parameters:
dx
- the x coordinate of the directiondy
- the y coordinate of the direction
-
rotate
public void rotate(int d) Rotates the figure in the specified direction.- Parameters:
d
- the direction of rotation (+1 right, -1 left)
-