shoot again lamp

This commit is contained in:
Jonas Zeunert
2022-06-07 01:05:35 +02:00
parent e422a62445
commit 17027e9411
2 changed files with 10 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import logging
import config import config
from lamps.Lamp import Lamp from lamps.Lamp import Lamp
from lamps.Lamp import SHOOT_AGAIN
from lamps.LampGroup import CHAMP_LAMPS from lamps.LampGroup import CHAMP_LAMPS
from lamps.LampGroup import UPPER_PLAYFIELD_TIME_LAMPS from lamps.LampGroup import UPPER_PLAYFIELD_TIME_LAMPS
from lamps.LampGroup import TUNNEL_NUMBER_LAMPS from lamps.LampGroup import TUNNEL_NUMBER_LAMPS
@@ -139,17 +140,20 @@ class PlayerState:
def reset(self): def reset(self):
self.resetBall() self.resetBall()
self.upperPlayfieldTime = next(self.upperPlayfieldTimeIter) self.points = 0
self.replayBall = False
self.hasBallScored = False
def resetBall(self): def resetBall(self):
self.resetBanks() self.resetBanks()
self.resetTargets() self.resetTargets()
self.printSpecial() self.printSpecial()
self.upperPlayfieldTime = next(self.upperPlayfieldTimeIter)
self.upperPlayfieldTimer = None self.upperPlayfieldTimer = None
self.upperPlayfieldTimeIter = iter(UPPER_PLAYFIELD_TIME) self.upperPlayfieldTimeIter = iter(UPPER_PLAYFIELD_TIME)
self.replayBall = False
self.hasBallScored = False
SHOOT_AGAIN.activate()
self.resetBonus() self.resetBonus()
def resetBonus(self): def resetBonus(self):
@@ -280,6 +284,7 @@ class PlayerState:
return return
if not self.hasBallScored: if not self.hasBallScored:
SHOOT_AGAIN.deactivate()
self.hasBallScored = True self.hasBallScored = True
self.points += points self.points += points

View File

@@ -13,4 +13,5 @@ class Lamp:
def isActivated(self): def isActivated(self):
networking.getLamps(self) networking.getLamps(self)
CREDIT = Lamp('Credit') CREDIT = Lamp('Credit')
SHOOT_AGAIN = Lamp('Ball')