Ejemplo n.º 1
0
    def __init__(self, director):
        Scene.__init__(self, director)
        layer = Layer(director)
        self.backgroundImage = load_image("main_menu_background.png")
        self.leftCoverImage = load_image("left_cover.png")
        newGameImage = load_image("new_game.png")
        buttonWidth = 214
        style = ImageButton.createImageButtonStyle(newGameImage, buttonWidth)
        self.newGameButton = ImageButton.ImageButton(self.director, (60, 110),
                                                     style)
        # Next Scene, we could do just self.newGameButton.onMouseDown = self.loadNewGame
        # put this way loadNewGame can take parameters too
        self.newGameButton.onMouseDown = lambda: self.loadNewGame()
        layer.append(self.newGameButton)
        self.layers.append(layer)

        load_music("menu.xm")
        pygame.mixer.music.set_volume(0.5)
        pygame.mixer.music.play(-1)
Ejemplo n.º 2
0
    def __init__(self, director):
        Scene.__init__(self, director)
        layer = Layer(director)
        self.backgroundImage = load_image("main_menu_background.png")
        self.leftCoverImage = load_image("left_cover.png")
        newGameImage = load_image("new_game.png")
        buttonWidth = 214
        style = ImageButton.createImageButtonStyle(newGameImage, buttonWidth)
        self.newGameButton = ImageButton.ImageButton(
            self.director, (60, 110), style)
        # Next Scene, we could do just self.newGameButton.onMouseDown = self.loadNewGame
        # put this way loadNewGame can take parameters too
        self.newGameButton.onMouseDown = lambda: self.loadNewGame()
        layer.append(self.newGameButton)
        self.layers.append(layer)

        load_music("menu.xm")
        pygame.mixer.music.set_volume(0.5)
        pygame.mixer.music.play(-1)
Ejemplo n.º 3
0
    def __init__(self, screen, screen_size, mapFile = ""):

        _player = Player(self, (0, 0, -5))
        Scene.__init__(self, screen, screen_size, mapFile, _player)

        self.InstanciateMap()