kp
This commit is contained in:
16
GameState.py
16
GameState.py
@@ -6,6 +6,9 @@ from itertools import cycle
|
||||
from lamps.LampGroup import *
|
||||
import asyncio
|
||||
import threading
|
||||
from Sound import Sound
|
||||
from sounds.YoureChamp import YoureChamp
|
||||
from sounds.YoureGood import YoureGood
|
||||
|
||||
class GameState:
|
||||
playerCount = 0
|
||||
@@ -35,6 +38,10 @@ class GameState:
|
||||
|
||||
self.checkHighscore()
|
||||
self.currentPlayer = next(self.players)
|
||||
Lamp("Highest Score").deactivate()
|
||||
if self.currentPlayer.hasHighScore:
|
||||
Lamp("Highest Score").activate()
|
||||
|
||||
def checkHighscore(self):
|
||||
highestScorePlayer = None
|
||||
|
||||
@@ -61,6 +68,10 @@ class GameState:
|
||||
logging.info("Game Started")
|
||||
|
||||
def endGame(self):
|
||||
for player in self.playerList:
|
||||
if player.hasHighscore:
|
||||
YoureChamp().play()
|
||||
|
||||
self.checkHighscore()
|
||||
self.writeHighscore()
|
||||
self.players = None
|
||||
@@ -103,7 +114,10 @@ class GameState:
|
||||
def idleLoop(self):
|
||||
all_cabinet_lamps = [BONUS_LAMPS, BONUS_MULTIPLIER_LAMPS, CHAMP_LAMPS,
|
||||
UPPER_PLAYFIELD_TIME_LAMPS, TUNNEL_NUMBER_LAMPS,
|
||||
TUNNEL_LAMPS, TUNNEL_SCORE_LAMPS]
|
||||
TUNNEL_LAMPS, TUNNEL_SCORE_LAMPS, ORANGE_SPECIAL_LAMPS]
|
||||
|
||||
YoureGood().play()
|
||||
|
||||
while True:
|
||||
for _ in range(20):
|
||||
random_group = random.choice(all_cabinet_lamps)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from Target import Target
|
||||
|
||||
from Sound import Sound
|
||||
class LeftSlingshotTarget(Target):
|
||||
def __init__(self):
|
||||
super().__init__(100, 'Left Slingshot')
|
||||
|
||||
def hit(self):
|
||||
Sound(6).play()
|
||||
super().hit()
|
||||
@@ -1,4 +1,5 @@
|
||||
from Target import Target
|
||||
from Sound import Sound
|
||||
|
||||
|
||||
class RightSlingshotTarget(Target):
|
||||
@@ -6,4 +7,5 @@ class RightSlingshotTarget(Target):
|
||||
super().__init__(10, "Right Slingshot")
|
||||
|
||||
def hit(self):
|
||||
Sound(6).play()
|
||||
super().hit()
|
||||
Reference in New Issue
Block a user