Beispiel #1
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col  = other as Coleccionable;
            Agujero       obs  = other as Agujero;
            Asteroide     ball = other as Asteroide;

            if (col != null)
            {
                col.Destroy();
                powerUpTotales++;
                Game1.INSTANCE.ventanaJuego.score += 1000;

                if (buffLevel < 5)
                {
                    buffLevel++;
                }
                //Console.WriteLine(powerUpTotales);
            }
            if (obs != null)
            {
                if (!invulnerable)
                {
                    invulnerable     = true;
                    objetoFisico.pos = Respawn();
                }
            }
            if (ball != null)
            {
                if (!invulnerable)
                {
                    vidas--;
                    ball.hp--;
                }
            }
        }
Beispiel #2
0
        public override void OnCollision(UTGameObject other)
        {
            Asteroide ball = other as Asteroide;

            if (ball != null)
            {
                ball.hp -= 1;

                //Console.WriteLine(ball.hp);
                isDestroyed = true;
                Destroy();
            }
        }
Beispiel #3
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col  = other as Coleccionable;
            Asteroide     ball = other as Asteroide;
            Proyectil     pry  = other as Proyectil;

            if (col != null)
            {
                col.Destroy();
            }
            if (ball != null)
            {
                ball.Destroy();;
            }
            if (pry != null)
            {
                pry.isDestroyed = true;
                pry.Destroy();;
            }
        }