Example #1
0
    def __init__(self, engine):
        Scene.__init__(self, engine)

        self.addCenteredText("The Saga of", 20, size=28)
        self.addCenteredText("Mo'Larr The Barbarian", 80, size=60)
        self.addCenteredText("Crusher of Candies!", 150, size=60)
        self.addCenteredText("(Press any key to start)", 300, size=20)
Example #2
0
    def __init__(self, engine):
        Scene.__init__(self, engine)
        self.addCenteredText("Game Over!", 100, size=72)
        self.addCenteredText("Your score was " + str(self.engine.score), 250, size=30)

        numSeconds = round(float(self.engine.timeKeeper.timer) / 1000, 1)

        self.addCenteredText("You managed to last a total of " + str(self.engine.msToHMS(self.engine.timeKeeper.timer)),
                             320, size=30)
        self.addCenteredText("And you crushed a total of " + str(self.engine.player.numCandiesCrushed) + " candies!",
                             390, size=30)
        self.addCenteredText("Press Escape to quit, or any other key to start a new game", 500, size=30)
Example #3
0
    def __init__(self, engine):
        Scene.__init__(self, engine)

        pygame.mixer.init()
        pygame.mixer.music.set_volume(0.3)
        pygame.mixer.music.load(OPENING_MUSIC_FILE)
        pygame.mixer.music.play()

        # Number of ms to show text before fading out
        self.timeBeforeBlackOut = 3000
        # Number of ms between screens
        self.timeBetweenScreens = 500

        # Timers
        self.preBlackOutTimer = 0
        self.blackOutTimer = 0

        #Kind of an ugly hack, but I don't have time to refactor all of this properly.
        self.screens = [
            self.screen1,
            self.screen2,
            self.screen3,
            self.screen4,
            self.screen5,
            self.screen6,
            self.screen7,
            self.screen8,
            self.screen9
        ]

        self.images = []
        self.currentScreenIndex = 0

        self.screens[self.currentScreenIndex]()

        self.playingDuctTapeSound = False
Example #4
0
    def render(self):

        self.engine.screen.fill(BLACK)

        if self.preBlackOutTimer < self.timeBeforeBlackOut:
            self.preBlackOutTimer += self.engine.clock.get_time()

            for img in self.images:
                self.engine.screen.blit(img["image"], img["position"])

            Scene.render(self)

        elif self.blackOutTimer < self.timeBetweenScreens:

            self.blackOutTimer += self.engine.clock.get_time()

        else:
            self.resetScreen()

            if self.currentScreenIndex < len(self.screens) - 1:
                self.currentScreenIndex += 1
                self.screens[self.currentScreenIndex]()
            else:
                self.engine.changeScene("mainMenu")
Example #5
0
    def render(self):
        self.engine.screen.fill(BLACK)

        Scene.render(self)