Moving. /JL

This commit is contained in:
2025-04-21 21:33:34 +02:00
parent a4a4b19d86
commit d5f9188865
3 changed files with 22 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ from dropzone import DropZone
from dropnext import DropNext
from hud import Hud
__version__ = "0.0.1"
__version__ = "0.0.2"
# Constants
HAT_REPEAT_DELAY = 0 # milliseconds before first repeat
@@ -43,7 +43,7 @@ class Tetris:
print(self.next.color)
self.hud = Hud(self.screen_width, self.screen_height, TILE_SIZE)
self.dropzone = DropZone(width = TILE_SIZE * 10, height = TILE_SIZE * 18)
self.dropzone = DropZone(TILE_SIZE, width = 10, height = 18)
self.dropnext = DropNext(width = TILE_SIZE * 4, height = TILE_SIZE * 4)
self.clock = pygame.time.Clock()
@@ -57,7 +57,8 @@ class Tetris:
self.screen.fill(enums.BrickColor.Cyan.value)
self.hud.draw(self.screen)
self.dropzone.draw(self.screen, TILE_SIZE)
self.dropzone.draw(self.screen)
self.dropzone.draw_brick(self.current.brick, self.current.location)
self.dropnext.draw(self.screen, TILE_SIZE)
self.dropnext.draw_block(self.next.brick)
@@ -97,11 +98,13 @@ class Tetris:
break
self.current.direction = enums.BrickDirection.Right
self.current.move_right()
self.dropzone.draw_brick(self.current.brick, self.current.location)
case pygame.K_LEFT:
if self.current.direction == enums.BrickDirection.Dropped:
break
self.current.direction = enums.BrickDirection.Left
self.current.move_left()
self.dropzone.draw_brick(self.current.brick, self.current.location)
case pygame.K_UP:
if self.current.direction == enums.BrickDirection.Dropped:
break