Skip to content

Commit

Permalink
Update tetris/main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
schielb authored Aug 31, 2023
1 parent 9e02ea0 commit 2b21905
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions demos/tetris/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from os.path import exists

from demos.utils import get_all_from_queue
from pygame import mixer


class Tetris:
Expand Down Expand Up @@ -47,6 +48,8 @@ def __init__(self, input_queue, output_queue, screen):
file.write("AA 0\n")
file.close()

mixer.init()

def run(self):
# Create generator here

Expand Down Expand Up @@ -164,6 +167,8 @@ def run(self):
self.draw_shape(prev_shape_location, erase=True)
self.draw_shape(shape_location)
prev_shape_location = shape_location.copy()
mixer.music.load('./demos/tetris/trickle.mp3')
mixer.music.play()

is_falling = self.is_falling(shape_location)

Expand Down Expand Up @@ -746,4 +751,5 @@ def get_letter(self, x, y):

def stop(self):
# Reset the state of the demo if needed, else leave blank
mixer.quit()
pass

0 comments on commit 2b21905

Please sign in to comment.