def launchNewGame(titleScreen): print('launchNewGame') newGame = game.game(images, screen, clock, iFace, FX, iH, titleScreen, SFX, myWorldBall, loadHero=C.mainLoop(screen)) FX.fadeOut(0) iFace.state = 'game' if newGame.mainLoop(): endScreen(newGame, "You Win!") else: endScreen(newGame, "Game Over.") FX.fadeOut(0)
def loadSavedGame(titleScreen): if android: android.hide_keyboard() try: FX.displayLoadingMessage(titleScreen, 'Loading game file...') savFile = gzip.GzipFile('ransack0.sav', 'rb', 1) FX.displayLoadingMessage(titleScreen, 'Loading saved game...') ball = cPickle.load(savFile) savFile.close() Game = game.game(images, screen, clock, iFace, FX, iH, titleScreen, SFX, myWorldBall, ball[0], ball[1], ball[2], ball[3]) FX.fadeOut(0) iFace.state = 'game' if Game.mainLoop(): endScreen(Game, "You Win!") else: endScreen(Game, "Game Over.") FX.fadeOut(0) except IOError as err: print('loadSavedGame error: {}'.format(err))
def loadSavedGame(titleScreen): if android: android.hide_keyboard() try: FX.displayLoadingMessage(titleScreen, 'Loading game file...') savFile = gzip.GzipFile('ransack0.sav', 'rb', 1) FX.displayLoadingMessage(titleScreen, 'Loading saved game...') ball = cPickle.load(savFile) savFile.close() Game = game.game(images, screen, clock, iFace, FX, iH, titleScreen, SFX, myWorldBall, ball[0], ball[1], ball[2], ball[3]) FX.fadeOut(0) iFace.state = 'game' if Game.mainLoop(): endScreen(Game, "You Win!") else: endScreen(Game, "Game Over.") FX.fadeOut(0) except IOError as err: print ('loadSavedGame error: {}'.format(err))