blaa
This commit is contained in:
20
GameState.py
20
GameState.py
@@ -49,21 +49,29 @@ class GameState:
|
||||
|
||||
def stopIdleLoop(self):
|
||||
self.isIdle.set()
|
||||
self.deactivate_all()
|
||||
pass
|
||||
|
||||
def deactivate_all(self):
|
||||
all_cabinet_lamps = [BONUS_LAMPS, BONUS_MULTIPLIER_LAMPS, CHAMP_LAMPS,
|
||||
UPPER_PLAYFIELD_TIME_LAMPS, TUNNEL_NUMBER_LAMPS,
|
||||
TUNNEL_LAMPS, TUNNEL_SCORE_LAMPS]
|
||||
for lamp_group in all_cabinet_lamps:
|
||||
lamp_group.deactivate()
|
||||
|
||||
async 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]
|
||||
while True:
|
||||
#for lamps in all_cabinet_lamps:
|
||||
#for _ in lamps.lamps:
|
||||
#lamps.cycle()
|
||||
#if not self.isIdle:
|
||||
# return
|
||||
#time.sleep(0.1)
|
||||
random_group = random.choice(all_cabinet_lamps)
|
||||
random_group.toggleRandom(0.2)
|
||||
for lamps in all_cabinet_lamps:
|
||||
for _ in lamps.lamps:
|
||||
lamps.cycle()
|
||||
if self.isIdle.is_set():
|
||||
return
|
||||
time.sleep(0.05)
|
||||
if self.isIdle.is_set():
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user