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