def __init__(self, name, snake, FPS=5, scale=20, LIVES=3): SinglePlayerGame.__init__(self, name, snake, FPS, scale, LIVES)
start_screen = StartGameScreen(GAME_NAME) start_screen.init((400, 300), 0, 32) game_mode = start_screen.get_game_mode(['Single Player', 'Play With Computer', 'Multi Player (as Server)','Multi Player']) print game_mode if game_mode == Mode.SINGLEPLAYER: GAME_NAME += ' {Single Player}' point1 = point.Point(1,1) point2 = point.Point(2,1) point3 = point.Point(3,1) snake1 = snake.Snake(0, [point1, point2, point3], Direction.RIGHT, "yellow") game = SinglePlayerGame(GAME_NAME, snake1, 8) game.init((400, 300), 0, 32) if not game.begin_game(): break elif game_mode == Mode.SINGLEPLAYERWITHCOMP: GAME_NAME += ' {You v/s Computer}' point1 = point.Point(1,1) point2 = point.Point(2,1) point3 = point.Point(3,1) snake1 = snake.Snake(0, [point1, point2, point3], Direction.RIGHT, "yellow") game = SinglePlayerGameWithComp(GAME_NAME, snake1, 8, LIVES=10 ) game.init((400, 300), 0, 32) if not game.begin_game(): break
def single_player(self, spritesheet: str): '''@return SinglePlayerGame''' return SinglePlayerGame(spritesheet)