def join_game(self): constants.MULTIPLAYER = True utils.play_sound("Enter.wav") c = Objects.get_client() c.start_server() # start client server connection = c.server_connect() # connect to game server if not connection: c.stop_server() menu_player.stop() self.game_started = True
def on_win(self): Objects.reset_game() server = Objects.get_server(self.levelName) server.curLevel = self.level+1 utils.play_sound("Enter.wav") game = Scene(server.map, server) game.add(ImageLayer(os.path.join("images", "backgrounds", "notebook-paper.png")), z=BACKGROUND_Z) director.push(game) menu_player.stop() self.game_started = True
def start_game(self): constants.MULTIPLAYER = True server = Objects.get_controller() server.client_start_game() if server.serverStarted: utils.play_sound("Enter.wav") game = Scene(server.map, server) menu_player.stop() game.add(ImageLayer( os.path.join("images", "backgrounds", "notebook-paper.png")), z=BACKGROUND_Z) director.push(game) self.game_started = True else: print "start server first"