Exemplo n.º 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--;
                }
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        public override void OnCollision(UTGameObject other)
        {
            Gato col = other as Gato;

            if (col != null)
            {
                col.Destroy();
            }
        }
Exemplo n.º 4
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col = other as Coleccionable;

            if (col != null)
            {
                col.Destroy();
                puntaje++;
                Console.WriteLine(puntaje);
            }
        }
Exemplo n.º 5
0
        public Vector2 Respawn()
        {
            vidas--;
            respawnPos.X = Game1.INSTANCE.ventanaJuego.camara.pos.X + Game1.INSTANCE.GraphicsDevice.Viewport.Width / 2f;
            respawnPos.Y = Game1.INSTANCE.ventanaJuego.camara.pos.Y + Game1.INSTANCE.GraphicsDevice.Viewport.Height;

            objetoFisico.isTrigger = true;
            shield = new UTGameObject("energyShield", objetoFisico.pos, 0.2f, FF_form.Circulo, false, true);
            shield.objetoFisico.isTrigger = true;

            return(respawnPos);
        }
Exemplo n.º 6
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();
            }
        }
Exemplo n.º 7
0
        public override void OnCollision(UTGameObject other)
        {
            Coleccionable col  = other as Coleccionable;
            Agujero       obs  = other as Agujero;
            Pelota        ball = other as Pelota;

            if (ball != null)
            {
                if (ball.hitByCar == true)
                {
                    hitByCar = true;
                }
            }
        }
Exemplo n.º 8
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();
            }
        }
Exemplo n.º 9
0
        public Escena2()
        {
            UTGameObjectsManager.Init();

            listaAgujeros = new List <Coleccionable>();

            this.shoot = Game1.INSTANCE.Content.Load <SoundEffect>("Laser Gun Sound Effect");

            playerUTG = new Gato("la_navesita_bebelin", new Vector2(1000, 500), .0f, 2f, UTGameObject.FF_form.Circulo);


            //murallas a los lados

            //derecha
            new UTGameObject("muralla_laser2", new Vector2(4220, 300), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser2", new Vector2(4220, 600), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser2", new Vector2(4220, 1200), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);

            //izquierda
            new UTGameObject("muralla_laser2", new Vector2(0, 180), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser2", new Vector2(0, 2000), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser2", new Vector2(0, 3000), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);


            //muralla de arriba
            new UTGameObject("muralla_laser", new Vector2(270, 0), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(1010, 0), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(1750, 0), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(2490, 0), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(3500, 0), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);

            //murallas de abajo
            new UTGameObject("muralla_laser", new Vector2(270, 2380), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(1010, 2380), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(1750, 2380), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(2490, 2380), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);
            new UTGameObject("muralla_laser", new Vector2(3500, 2380), 0, 6, UTGameObject.FF_form.Rectangulo, true, false);



            camara2 = new Camara(new Vector2(0, 0), 1, 0);

            this.musica = Game1.INSTANCE.Content.Load <Song>("_ Ambient Space Music (No Copyright)");
            MediaPlayer.Play(this.musica);
        }
Exemplo n.º 10
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();;
            }
        }
Exemplo n.º 11
0
        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;
                }
            }
        }
Exemplo n.º 12
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();
            }
        }