Beispiel #1
0
def enter(scene_args):
    audio.stop_all()
    audio.play_bgm('bgm1')
    audio.play_sfx('yolo')

    model = LevelOneModel.instance()
    model.time_board.start()
Beispiel #2
0
    def input(self, model, keystate, previous_keystate):
        self.reset_buffered_input()

        if keystate[pygame.K_SPACE] and not previous_keystate[pygame.K_SPACE]:
            audio.play_sfx('belup')
            self.input_teleport = True

            state.offset = screen_shake(2, 3)
            state.screen_shaking = True
Beispiel #3
0
    def draw(self, screen):
        super().draw(screen)
        self.draw_player(screen)
        self.draw_flame(screen)

        # TODO: Move these displays to a HUD class
        self.draw_hud(screen)

        # TODO: add a new scene for the game over screen
        if self.health <= 0:
            #BUG:  Because the game over isn't a new scene, this will happen every frame.
            #BUG:  So the "Oh No! -pop-" SFX won't play right.
            audio.stop_all()
            audio.play_sfx('ohno')
            game_over.draw(screen)
Beispiel #4
0
def enter(scene_args):
    global score_text
    global time_text

    audio.stop_all()
    audio.play_sfx('ohno')
    audio.play_bgm('you_are_dead')

    score_text = Text("Score: {}".format(scene_args["score"]),
                      200,
                      200,
                      center=True)
    time_text = Text("Time: {}".format(round(scene_args["time"], 3)),
                     440,
                     200,
                     center=True)
Beispiel #5
0
    def input(self, model, keystate):
        self.reset_buffered_input()

        if keystate[pygame.K_LEFT]:
            self.move_angle = self.rotation_speed
        elif keystate[pygame.K_RIGHT]:
            self.move_angle = -self.rotation_speed

        if keystate[pygame.K_UP]:
            self.move_velocity = self.acceleration
        elif keystate[pygame.K_DOWN]:
            self.move_velocity = -self.acceleration

        if keystate[pygame.K_SPACE]:
            audio.play_sfx('pew')
            self.input_fire_seed = True
Beispiel #6
0
def enter():
    audio.stop_all()
    audio.play_bgm('bgm1')
    audio.play_sfx('yolo')