Exemplo n.º 1
0
    for bullet in map.bullets:
        for enemy in map.emenies:
            if not enemy.visible:
                map.remove_enemy(enemy)
            if Collision.bullet_and_target(bullet, enemy):
                enemy.hit()
                map.hero.score += 1
                map.remove_bullet(bullet)
        if bullet.x < 1280 and bullet.x > 0:
            bullet.x += bullet.vel
        else:
            map.remove_bullet(bullet)

    for block in map.blocks:
        if Collision.hero_on_block(block, map.hero) and not map.hero.is_jump:
            map.hero.y = block.hitbox[1] - 52
            map.hero.faling = False
        else:
            map.hero.faling = True
        if Collision.hero_under_block(block, map.hero):
            pass
        if Collision.hero_and_left_border_of_block(block, map.hero):
            pass
        if Collision.hero_and_right_border_of_block(block, map.hero):
            pass

        for bullet in map.bullets:
            if Collision.bullet_and_target(bullet, block):
                map.remove_bullet(bullet)