Exemple #1
0
        public Juego(ContentManager content)
        {
            UTGameObjectsManager.Init();

            timer         = content.Load <SpriteFont>("Titulo");
            vidasActuales = content.Load <SpriteFont>("Titulo");
            puntajeTotal  = content.Load <SpriteFont>("Titulo");

            timerIcon   = content.Load <Texture2D>("timer");
            vidasIcon   = content.Load <Texture2D>("vida");
            puntajeIcon = content.Load <Texture2D>("moneda");

            listaMuros    = new List <UTGameObject>();
            listaPelotas  = new List <Pelota>();
            listaAgujeros = new List <Agujero>();
            listaMonedas  = new List <Coleccionable>();

            auto = new Automovil(content, "Auto", new Vector2(450, Game1.INSTANCE.GraphicsDevice.Viewport.Height), 4, UTGameObject.FF_form.Rectangulo);

            rnd                     = new Random();
            time                    = 0;
            timeSpawnPelotas        = 0;
            timeSpawnAgujeros       = 0;
            timeSpawnMoneda         = 0;
            condicionalSpawnMonedas = 0;
            n_Choques               = 0;
            ganoVidas               = 25;

            pelotasEncestadas = 0;

            camara = new Camara(new Vector2(0, 0), .5f, 0);
            camara.HacerActiva();
        }
        public VentanaManager(ContentManager content)
        {
            UTGameObjectsManager.Init();

            titulo  = content.Load <SpriteFont>("Titulo");
            mensaje = content.Load <SpriteFont>("Instrucciones");
            accion  = content.Load <SpriteFont>("Accion");

            camara = new Camara(new Vector2(0, 0), .5f, 0);
            camara.HacerActiva();
        }
Exemple #3
0
        public VentanaManager(ContentManager content)
        {
            UTGameObjectsManager.Init();

            main_menu = content.Load <SpriteFont>("Main_menu");
            end_menu  = content.Load <SpriteFont>("End_menu");



            camara = new Camara(new Vector2(0, 0), .5f, 0);
            camara.HacerActiva();
        }
Exemple #4
0
        public VentanaManager(ContentManager content)
        {
            UTGameObjectsManager.Init();

            titulo  = content.Load <SpriteFont>("Titulo");
            mensaje = content.Load <SpriteFont>("Instrucciones");
            accion  = content.Load <SpriteFont>("Accion");

            camara = new Camara(new Vector2(0, 0), .5f, 0);
            camara.HacerActiva();

            AudioManager.PlaySong("MainGameSoundTrack", loop: true);
        }
Exemple #5
0
        public Juego(ContentManager content)
        {
            UTGameObjectsManager.Init();

            fondo = content.Load <Texture2D>("fondo");

            timer         = content.Load <SpriteFont>("Titulo");
            vidasActuales = content.Load <SpriteFont>("Titulo");
            puntajeTotal  = content.Load <SpriteFont>("Instrucciones");
            powerUpLevel  = content.Load <SpriteFont>("Instrucciones");

            timerIcon    = content.Load <Texture2D>("timer");
            vidasIcon    = content.Load <Texture2D>("vida");
            powerUpIcon  = content.Load <Texture2D>("energy");
            asteroidIcon = content.Load <Texture2D>("Asteroid");

            difficultyLevel = 1;
            cameraSpeed     = 6;

            score = 0;

            listaFondo      = new List <Background>();
            listaAsteroides = new List <Asteroide>();
            listaAgujeros   = new List <Agujero>();
            listaEnergy     = new List <Coleccionable>();

            listaProyectiles = new List <Proyectil>();

            ship = new Nave(content, "ship", new Vector2(450, Game1.INSTANCE.GraphicsDevice.Viewport.Height), 0.3f, UTGameObject.FF_form.Rectangulo);

            rnd  = new Random();
            time = 0;
            timeChangeDifficulty = 0;
            timeSpawnAsteroides  = 0;
            timeSpawnAgujeros    = 0;
            timeSpawnEnergy      = 0;

            n_Choques = 0;
            ganoVidas = false;

            camara = new Camara(new Vector2(0, 0), .5f, 0);
            camara.HacerActiva();

            listaFondo.Add(new Background("fondo", new Vector2(camara.pos.X, camara.pos.Y + Game1.INSTANCE.GraphicsDevice.Viewport.Height), 2, UTGameObject.FF_form.Rectangulo, true, false, true));
            listaFondo.Add(new Background("fondo", new Vector2(camara.pos.X + Game1.INSTANCE.GraphicsDevice.Viewport.Width * 2, camara.pos.Y + Game1.INSTANCE.GraphicsDevice.Viewport.Height), 2, UTGameObject.FF_form.Rectangulo, true, false, true));
        }
        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);
        }
Exemple #7
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }



            //Console.WriteLine(gameTime.ElapsedGameTime.TotalSeconds);
            // TODO: Add your update logic here
            Escena.INSTANCIA?.Update(gameTime);
            MotorFisico.Update(gameTime);
            UTGameObjectsManager.Update(gameTime);


            base.Update(gameTime);
        }
Exemple #8
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            now = Keyboard.GetState();

            if (now.IsKeyUp(Keys.O) && last.IsKeyDown(Keys.O))
            {
                paused = !paused;
                pause.Play();
            }

            if (paused)
            {
                last = now;

                return;
            }

            //Console.WriteLine(gameTime.ElapsedGameTime.TotalSeconds);
            // TODO: Add your update logic here

            Escena.INSTANCIA?.Update(gameTime);
            MotorFisico.Update(gameTime);
            UTGameObjectsManager.Update(gameTime);


            if (!EnterPressed && Keyboard.GetState().IsKeyDown(Keys.Enter) && pantalla == GameState.Inicio)
            {
                plink.Play();
                EnterPressed = true;
                pantalla     = GameState.Gameplay;
                new Escena2();
            }
            if (Keyboard.GetState().IsKeyUp(Keys.Enter))
            {
                EnterPressed = false;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.I) && pantalla == GameState.Inicio)
            {
                plink.Play();
                pantalla = GameState.Instruct;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Back) && pantalla == GameState.Instruct)
            {
                plink.Play();
                pantalla = GameState.Inicio;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.C) && pantalla == GameState.Inicio)
            {
                plink.Play();
                pantalla = GameState.Creditos;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Back) && pantalla == GameState.Creditos)
            {
                plink.Play();
                pantalla = GameState.Inicio;
            }
            if (pantalla == GameState.Final && Keyboard.GetState().IsKeyDown(Keys.R))
            {
                plink.Play();
                pantalla = GameState.Inicio;
            }


            gameplay.Update(gameTime);

            base.Update(gameTime);

            last = now;
        }
Exemple #9
0
 public EscenaInicial()
 {
     UTGameObjectsManager.Init();
     camara2 = new Camara(new Vector2(0, 0), .3f, 0);
 }
Exemple #10
0
        public Juego()
        {
            UTGameObjectsManager.Init();

            listaMonedas = new List <Coleccionable>();

            auto = new Automovil("Auto", new Vector2(450, 400), 4, UTGameObject.FF_form.Circulo);

            new UTGameObject("Muro2", new Vector2(300, 400), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(900, 400), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(300, 700), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(900, 700), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(300, 1000), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(900, 1000), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(300, 1300), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro", new Vector2(1000, 1200), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(400, 1500), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(700, 1500), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(1000, 1500), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro", new Vector2(1300, 1200), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(1300, 1500), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro", new Vector2(1600, 1200), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(1600, 1500), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(1800, 1200), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro", new Vector2(1900, 1500), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(2200, 1500), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(2400, 1400), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(2400, 1100), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro", new Vector2(2000, 900), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(2300, 900), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(1400, 1000), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(1400, 700), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(2000, 700), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(1400, 400), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(2000, 400), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(1400, 100), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(2000, 100), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro2", new Vector2(1400, -200), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro2", new Vector2(2000, -200), 1, UTGameObject.FF_form.Rectangulo, true);

            new UTGameObject("Muro", new Vector2(1550, -400), 1, UTGameObject.FF_form.Rectangulo, true);
            new UTGameObject("Muro", new Vector2(1850, -400), 1, UTGameObject.FF_form.Rectangulo, true);

            /*PELOTAS**************************************************************************************************/

            new UTGameObject("obstaculo", new Vector2(451.0252f, 692.5721f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(729.0478f, 694.5721f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(579.0478f, 926.7676f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(714.3812f, 1296.573f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1354.681f, 1409.677f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(2223.635f, 1377.104f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(2091.635f, 1231.104f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1905.635f, 1107.104f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(2241.635f, 1053.104f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1550.839f, 980.4282f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1673.601f, 816.618f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1865.601f, 670.618f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1525.601f, 648.618f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1709.601f, 512.3312f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1873.601f, 378.3312f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1551.601f, 356.3312f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1767.601f, 203.3781f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1569.601f, 127.3781f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1867.731f, -54.39938f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1709.731f, -64.39938f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1543.731f, -64.39938f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1615.731f, -256.3994f), 0.02f, UTGameObject.FF_form.Circulo, false);
            new UTGameObject("obstaculo", new Vector2(1801.731f, -2603994f), 0.02f, UTGameObject.FF_form.Circulo, false);

            /*MONEDAS*****************************************************************************************************************/


            listaMonedas.Add(new Coleccionable("moneda", new Vector2(740.2859f, 1054.476f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1576.667f, 1302.191f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(2234.863f, 1218.269f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1540.868f, 1087.637f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1547.633f, 820.8824f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1831.249f, 514.5972f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1565.249f, 504.5972f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1633.058f, 241.2628f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1775.82f, -178.2617f), .1f, UTGameObject.FF_form.Circulo));
            listaMonedas.Add(new Coleccionable("moneda", new Vector2(1637.82f, -176.2617f), .1f, UTGameObject.FF_form.Circulo));



            camara = new Camara(new Vector2(0, 0), .5f, 0);
            camara.HacerActiva();
        }