mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
feat(utils): add enum options
This commit is contained in:
parent
dbc445b323
commit
5a12de0c88
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user