feat: implement gravity on current piece

This commit is contained in:
2021-06-08 17:21:15 -04:00
parent b42a2c377b
commit 52cbec5a8f
3 changed files with 28 additions and 6 deletions

View File

@@ -40,9 +40,11 @@ class Tetris:
# gets called from the games main loop
def update(self) -> None:
# TODO write not initialized exception
elapsed_time = self.clock.tick(self.fps)
if self.current_piece:
self.current_piece.update(elapsed_time, self.well, self.stack)
self.clock.tick(self.fps)
# TODO create control utility class
for event in pygame.event.get():
if event.type == pygame.QUIT: