diff options
| author | LeightonGinty <57670831+LeightonGinty@users.noreply.github.com> | 2024-11-16 23:21:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-16 23:21:25 +0000 |
| commit | ee6bdec85980a95f147fdbe12d5bd451cb8931c0 (patch) | |
| tree | 036423119cdcb7244286178e7b253998457561f9 | |
| parent | 36621bf761610fcf0a33babb31fd497bb0ffec0c (diff) | |
Update driving.py
Make threads repeat and add game over text
| -rw-r--r-- | driving.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -28,14 +28,18 @@ playing = True startup_time = 0
for i in range(len(opposing_vehicle_ys)):
screen.rect(13+opposing_vehicle_lanes[i]*40, opposing_vehicle_ys[i],20,40,(500, 500, 555),1)
-# def play_music():
+def play_music(CHASE):
+ while True:
+ buzzer.melody(CHASE)
CHASE = "a4:1 b c5 b4 a:2 r a:1 b c5 b4 a:2 r a:2 e5 d# e f e d# e b4:1 c5 d c b4:2 r b:1 c5 d c b4:2 r b:2 e5 d# e f e d# e "
-new_thread = _thread.start_new_thread(buzzer.melody, [CHASE])
+# new_thread = _thread.start_new_thread(play_music, [CHASE])
+
while playing and driving:
+
# WAWA = "e3:3 r:1 d#:3 r:1 d:4 r:1 c#:8 "
startup_time += 1
@@ -89,3 +93,4 @@ while playing and driving: screen.rect(93,80,20,40,(0, 0, 0),1)
screen.refresh()
+screen.text("GAME OVER", x=10, y=90, ext=1, color=255)
|
