Add replay ball
This commit is contained in:
@@ -7,7 +7,6 @@ from events.LeftFlapEvent import LeftFlapEvent
|
||||
from events.RightKickerEvent import RightKickerEvent
|
||||
from events.EnterUpperPlayfieldEvent import EnterUpperPlayfieldEvent
|
||||
from events.StartGameEvent import StartGameEvent
|
||||
from events.EndGameEvent import EndGameEvent
|
||||
from events.StartBallEvent import StartBallEvent
|
||||
from events.BottomRightBankEvent import BottomRightBankEvent
|
||||
from events.BottomLeftBankEvent import BottomLeftBankEvent
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import config
|
||||
from __main__ import networking
|
||||
|
||||
from factories.PlayerStateFactory import PlayerStateFactory
|
||||
@@ -29,15 +30,20 @@ class GameFactory:
|
||||
|
||||
PLAYER_LAMPS.activateNext()
|
||||
|
||||
def getHighScore(self):
|
||||
with open(config.HIGHSCORE_FILE, "rw+") as file:
|
||||
score_str = file.readline()
|
||||
|
||||
if score_str == "":
|
||||
score_str = "0"
|
||||
|
||||
return int(score_str)
|
||||
|
||||
def createGame(self):
|
||||
inputHandler = InputHandler(self.targets)
|
||||
|
||||
gameState = GameState(self.playerStateFactory, self.getHighScore(), self.specialDisplay)
|
||||
|
||||
eventFactory = EventFactory(self.targets, gameState)
|
||||
events = eventFactory.allEvents()
|
||||
|
||||
return Game(inputHandler, gameState, events)
|
||||
|
||||
def getHighScore(self): # todo
|
||||
return 0
|
||||
return Game(inputHandler, gameState, events)
|
||||
Reference in New Issue
Block a user