def gameLoop(): #check if the workout is active isWorkoutActive = ErgStats.isWorkoutActive() if not isWorkoutActive: ErgStats.resetStatistics() playground.reset() else: #update the ergometer data ErgStats.update() playground.update(ErgStats.time) ui.update(playground) #display the message after the UI has been rendered if not isWorkoutActive: ui.showMessage("Please start rowing...")
def main(): # init the player boat player = BoatConcept2(dynrow_args.args.name) playground.setPlayerBoat(player) #init the AI boats playground.addBoat(BoatBoomerang("Armin", 130, 20, 20)) playground.addBoat(BoatBoomerang("Bahne", 135, 22, 20)) playground.addBoat(BoatRollingAverage("Emil", playground.getPlayerBoat())) if not newestGhost == "": playground.addBoat(BoatGhost("Ghost", newestGhost)) # Init the Concept2 ErgStats.connectToErg() #init the UI, register the GameLoop and run it ui.registerCallback(gameLoop) ui.setCycleTime(DELTAT) ui.run()