Пример #1
0
        public static void DrawInimigosSala3()
        {
            //enemy2 sala 2
            e25 = new Enemy2(new Vector2(3156, 400));
            e26 = new Enemy2(new Vector2(3276, 400));
            e27 = new Enemy2(new Vector2(3898, 400));
            entities.Add(e25);
            entities.Add(e26);
            entities.Add(e27);

            e13 = new Enemy1(new Vector2(3215, 100));
            e14 = new Enemy1(new Vector2(3250, 125));
            e15 = new Enemy1(new Vector2(3692, 125));
            e16 = new Enemy1(new Vector2(4450, 125));
            entities.Add(e13);
            entities.Add(e14);
            entities.Add(e15);
            entities.Add(e16);

            d3 = new Door(new Vector2(4950, 368));
            entities.Add(d3);

            eg1 = new ExitGame(new Vector2(5108, 368));
            entities.Add(eg1);
        }
Пример #2
0
        public override void CollisionDetected(Entity other)
        {
            if (other is Enemy1)
            {
                if (imune == true)
                {
                    return;
                }
                Game1.hum.SetHealth(-8);
                Game1.hum.imune = true;

                if (Game1.hum.GetHealth() <= 0)
                {
                    Game1.entities.Remove(Game1.hum);
                    //Game1.DrawHumano();
                    playSong.Stop();
                    Game1.currGameState = Game1.GameState.Null;
                    Game1.EnterGameState(Game1.currGameState);
                }
            }
            if (other is Enemy2)
            {
                if (imune == true)
                {
                    return;
                }
                Game1.hum.SetHealth(-8);
                Game1.hum.imune = true;

                if (Game1.hum.GetHealth() <= 0)
                {
                    Game1.entities.Remove(Game1.hum);
                    //Game1.DrawHumano();
                    playSong.Stop();
                    Game1.currGameState = Game1.GameState.Null;
                    Game1.EnterGameState(Game1.currGameState);
                }
            }

            if (other is PowerUp)
            {
                hasPowerUp = true;
                PowerUp p = (PowerUp)other;
                Game1.entities.Remove(p);
            }

            if (other is ExitGame)
            {
                ExitGame x = (ExitGame)other;
                Game1.entities.Remove(x);
                EnterPlayerState(PlayerState.Imune);
            }
        }