コード例 #1
0
ファイル: Automovil.cs プロジェクト: ivoryraeg/Proyecto-2
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col  = other as Coleccionable;
            Agujero       obs  = other as Agujero;
            Pelota        ball = other as Pelota;

            if (col != null)
            {
                col.Destroy();
                puntaje++;

                //Console.WriteLine(puntaje);
            }
            if (obs != null)
            {
                if (!invulnerable)
                {
                    invulnerable     = true;
                    objetoFisico.pos = Respawn();
                }
            }
            if (ball != null)
            {
                ball.hitByCar = true;
            }
        }
コード例 #2
0
ファイル: Nave.cs プロジェクト: Kn4ll-Nk/Taller-3
        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--;
                }
            }
        }
コード例 #3
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col = other as Coleccionable;

            if (col != null)
            {
                col.Destroy();
                puntaje++;
                Console.WriteLine(puntaje);
            }
        }
コード例 #4
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col   = other as Coleccionable;
            Enemigos      enemi = other as Enemigos;

            if (col != null)
            {
                col.Destroy();
                Destroy();
            }
            if (enemi != null)
            {
                enemi.Destroy();
                Destroy();
            }
        }
コード例 #5
0
ファイル: Agujero.cs プロジェクト: Kn4ll-Nk/Taller-3
        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();;
            }
        }
コード例 #6
0
ファイル: Agujero.cs プロジェクト: ivoryraeg/Proyecto-2
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col  = other as Coleccionable;
            Pelota        ball = other as Pelota;

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

                if (ball.hitByCar)
                {
                    Game1.INSTANCE.ventanaJuego.auto.puntaje += 10;
                    Game1.INSTANCE.ventanaJuego.pelotasEncestadas++;
                    ball.hitByCar = false;
                }
            }
        }
コード例 #7
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col   = other as Coleccionable;
            Enemigos      enemi = other as Enemigos;

            if (col != null)
            {
                col.Destroy();
                Destroy();
                plonk.Play();
                Game1.pantalla = GameState.Final;
                new Escena3();
            }
            if (enemi != null)
            {
                enemi.Destroy();
                Destroy();
                plonk.Play();
                Game1.pantalla = GameState.Final;
                new Escena3();
            }
        }