mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2026-03-22 00:36:20 +00:00
feat(utils): add enum options
This commit is contained in:
@@ -20,9 +20,7 @@ class Tetromino:
|
|||||||
]
|
]
|
||||||
|
|
||||||
def move_down(self) -> None:
|
def move_down(self) -> None:
|
||||||
if not self._check_horizontal_collision(
|
if not self._check_horizontal_collision(self.blocks, Direction.DOWN):
|
||||||
self.blocks, Direction.RIGHT
|
|
||||||
): # Direction.RIGHT = 1 aka DOWN
|
|
||||||
for block in self.blocks:
|
for block in self.blocks:
|
||||||
block.pos.y += 1
|
block.pos.y += 1
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,5 @@ from enum import Enum
|
|||||||
class Direction(Enum):
|
class Direction(Enum):
|
||||||
LEFT = -1
|
LEFT = -1
|
||||||
RIGHT = 1
|
RIGHT = 1
|
||||||
|
DOWN = 1
|
||||||
|
UP = -1
|
||||||
|
|||||||
Reference in New Issue
Block a user