Esempio n. 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();
                }
            }
        }
Esempio n. 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();
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 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);
         }
     }
 }