示例#1
0
        public override void addEntity(Entity entity)
        {
            base.addEntity(entity);
            if (!filled && (entity is GhostEntity || entity is GhostBossEntity)) {
                entity.remove();
                filled = true;
                blocksMotion = false;
                sprite.removed = true;

                for (int i = 0; i < 8; i++) {
                    RubbleSprite s = new RubbleSprite();
                    s.col = this.sprite.col;
                    addSprite(s);
                }

                if (entity is GhostBossEntity)
                {
                    level.addEntity(new KeyEntity(x, y));
                    Sound.bosskill.play();
                }
                else
                {
                    Sound.altar.play();
                }
            }
        }
示例#2
0
 public override void addEntity(Entity entity)
 {
     base.addEntity(entity);
     if (!filled && entity is BoulderEntity)
     {
         entity.remove();
         filled = true;
         blocksMotion = false;
         addSprite(new Sprite(0, 0, 0, 8 + 2, BoulderEntity.COLOR));
         Sound.thud.play();
     }
 }
示例#3
0
文件: Player.cs 项目: rlods/PocDotNet
 protected override void collide(Entity entity)
 {
     Bullet bullet = entity as Bullet;
     if (null != bullet)
     {
         if (bullet.owner.GetType() == this.GetType())
         {
             return;
         }
         if (hurtTime > 0) return;
         entity.remove();
         hurt(entity, 1);
     }
 }
示例#4
0
 protected override void collide(Entity entity)
 {
     Player player = entity as Player;
     if (null != player)
     {
         player.hurt(this, 1);
     }
     else
     {
         Bullet bullet = entity as Bullet;
         if (null != bullet) {
             if (bullet.owner.GetType() == this.GetType())
             {
                 return;
             }
             if (hurtTime > 0) return;
             entity.remove();
             hurt(entity.xa, entity.za);
         }
     }
 }