示例#1
0
        public override void onCollide(Entity entity, Game1 game)
        {
            if (entity is Player)
            {
                Boolean allEnemiesKilled = true;
                foreach (Entity e in game.entities)
                {
                    if (e is Enemy)
                    {
                        allEnemiesKilled = false;
                    }
                }

                if (allEnemiesKilled)
                {
                    game.loadLevel(nextLevel);
                }
                else
                {
                    game.showText("The door is still closed!");
                }
            }

            base.onCollide(entity, game);
        }
示例#2
0
        public override void onCollide(Entity entity, Game1 game)
        {
            if (entity is Player)
            {
                Boolean allEnemiesKilled = true;
                foreach (Entity e in game.entities)
                {
                    if (e is Enemy)
                    {
                        allEnemiesKilled = false;
                    }
                }

                if (allEnemiesKilled)
                {
                    game.loadLevel(nextLevel);
                }
                else
                {
                    game.showText("The door is still closed!");
                }
            }

            base.onCollide(entity, game);
        }
示例#3
0
 public override void onCollide(Entity entity, Game1 game)
 {
     if (entity is Player)
     {
         game.showText(text);
         //game.entities.Remove(this);
     }
 }
示例#4
0
 public override void onCollide(Entity entity, Game1 game)
 {
     if (entity is Player)
     {
         game.showText(text);
         //game.entities.Remove(this);
     }
 }