Esempio n. 1
0
 def update(self):
     for Trp in main_game.stage2_trap:
         for Mon in main_game.stage2_monster:
             if main_game.collide(Trp, Mon):
                 main_game.stage2_trap.remove(Trp)
         if main_game.collide(main_game.girl, Trp):
             if ITEM.protect_State >= 1:
                 ITEM.protect_State = ITEM.protect_State - 1
                 main_game.stage2_trap.remove(Trp)
             else:
                 title_state.gameoverMusic()
                 game_framework.push_state(game_over)
                 pass
Esempio n. 2
0
 def update(self):
     global protect_State
     for PROTECT in main_game.protected:
         if main_game.collide(main_game.girl, PROTECT):
             if protect_State == 0:
                 main_game.protected.remove(PROTECT)
                 protect_State = 1
             else:
                 pass
Esempio n. 3
0
def draw():
    clear_canvas()
    main_game.background.draw(game_value.middle[0], game_value.middle[1],
                              game_value.WINDOW_SIZE[0],
                              game_value.WINDOW_SIZE[1])
    for o in game_world.all_objects():
        if main_game.collide(o, main_game.back_screen):
            o.draw(main_game.back_screen)
    paused.draw(game_value.middle[0], game_value.middle[1],
                game_value.WINDOW_SIZE[0], game_value.WINDOW_SIZE[1])
    update_canvas()
Esempio n. 4
0
 def update(self, frame_time):
     for ATK in main_game.stage2_monster_attack:
         if main_game.collide(main_game.girl, ATK):
             ATK.eat()
             ATK.ATTACK = 1
     for ATK in main_game.stage2_monster_attack:
         if ATK.ATTACK == 1:
             ATK.y -= main_game.MAX_SPEED_PPS * frame_time * 0.05
             if self.attack_collide(ATK, main_game.girl):
                 if ITEM.protect_State >= 1:
                     ITEM.protect_State = ITEM.protect_State - 1
                     main_game.stage2_monster_attack.remove(ATK)
                 else:
                     title_state.gameoverMusic()
                     game_framework.push_state(game_over)
                     pass
Esempio n. 5
0
    def update(self):
        for Mon in main_game.stage1_monster:
            if Mon.y < 0:
                main_game.stage1_monster.remove(Mon)

            if main_game.collide(main_game.girl, Mon):
                main_game.score += 550
                main_game.stage1_monster.remove(Mon)
                main_game.girl.eat(Mon)

                main_game.hp_gauge.frame -= 13
                main_game.skill.skill_frame += 1

        self.monster_frame_speed += 1

        if self.monster_frame_speed % 10 == 0:
            self.frame = (self.frame + 1) % 8
Esempio n. 6
0
    def update(self):
        for Mon in main_game.stage4_monster:
            if Mon.y < 0:
                main_game.stage4_monster.remove(Mon)

            if main_game.collide(main_game.girl, Mon):
                if ITEM.protect_State >= 1:
                    ITEM.protect_State = ITEM.protect_State - 1
                    main_game.stage4_monster.remove(Mon)
                else:
                    title_state.gameoverMusic()
                    game_framework.push_state(game_over)

        self.monster_frame_speed += 1

        if self.monster_frame_speed % 10 == 0:
            self.frame = (self.frame + 1) % 7
Esempio n. 7
0
    def update(self):
        for Mon in main_game.stage3_monster:
            if Mon.y < 0:
                main_game.stage3_monster.remove(Mon)

            if main_game.collide(main_game.girl, Mon):
                main_game.score += 950
                main_game.stage3_monster.remove(Mon)
                main_game.girl.eat(Mon)

                for ATK in main_game.stage3_monster_attack:
                    if ATK.y == Mon.y:
                        main_game.stage3_monster_attack.remove(ATK)
                main_game.hp_gauge.frame -= 7
                main_game.skill.skill_frame += 1

        self.monster_frame_speed += 1
        if self.monster_frame_speed % 28 == 0:
            self.frame = (self.frame + 1) % 8