Exemple #1
0
def check_collision_playerskill(s):
    # 충돌 player skill with enemy
    for e in gfw.world.objects_at(gfw.layer.enemy):
        if collision.collides_box(s, e):
            e.explosion()
            music_explosion.play(1)
            return

    # 충돌 player skill with enemy_bullet
    for eb in gfw.world.objects_at(gfw.layer.enemy_bullet):
        if collision.collides_box(s, eb):
            eb.remove()
            return
Exemple #2
0
def check_collision_enemybullet(eb):
    # 충돌 enemy_bullet with player
    global player
    if not player.returninfo():
        if collision.collides_box(player, eb):
            player.explosion()
            music_explosion.play(1)
            return
Exemple #3
0
def check_collision_enemy(e):
    # 충돌 enemy with player
    global player
    if not player.returninfo():
        if collision.collides_box(player, e):
            e.explosion()
            player.explosion()
            music_explosion.play(1)
            return

    # 충돌 enemy with player bullet
    for b in gfw.world.objects_at(gfw.layer.bullet):
        if collision.collides_box(b, e):
            e.explosion()
            music_explosion.play(1)
            b.remove()
            return
Exemple #4
0
def check_collision_item():
    # 충돌 player with item
    for i in gfw.world.objects_at(gfw.layer.item):
        if collision.collides_box(player, i):
            if player.upgrade < 4:
                player.upgrade += 1
            i.remove()
            music_item.play(1)
            return
Exemple #5
0
def check_collision_boss():
    # 충돌 player with boss
    if collision.collides_box(player, boss):
        player.explosion()
        music_explosion.play(1)
        boss.hit = True

    # 충돌 player bullet with boss
    for b in gfw.world.objects_at(gfw.layer.bullet):
        if collision.collides_box(b, boss):
            b.remove()
            boss.hit = True
            # boss hp -
            boss.hp -= b.damage
            if boss.hp <= 0:
                boss.explosion()
                music_explosion.play(1)
            return

    # 충돌 player skill with boss
    for s in gfw.world.objects_at(gfw.layer.skill):
        if collision.collides_box(s, boss):
            # boss hp -
            boss.hit = True
            boss.hp -= s.damage
            if boss.hp <= 0:
                boss.explosion()
                music_explosion.play(1)
            return

    # 충돌 player with boss bullet
    for bb in gfw.world.objects_at(gfw.layer.boss_bullet):
        if collision.collides_box(player, bb):
            player.explosion()
            music_explosion.play(1)
            return