public override void Initialize() { spriteBatch = new SpriteBatch(Game.GraphicsDevice); creditosList = new List<Mapa>(); creditosList2 = new List<Mapa>(); tiempoEmpiezo = 0; pararCreditos = false; audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); waveBank2 = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank 2.xwb"); soundBank2 = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank 2.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); ambientWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Ambient.xwb"); ambientBank = new SoundBank(audioEngine, @"Content\Sonidos\Ambient Bank.xsb"); musicCategory = audioEngine.GetCategory("Default"); musicCategory.SetVolume(0); reproducirMusica("batidora"); puntero = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (455 / 2), (768 / 2) - 145), new Point(455, 142), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366/2)-(807/2), 768), new Point(807, 104), new Point(0, 0), new Point(0, 160), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (324 / 2), 768 + 120), new Point(324, 45), new Point(0, 0), new Point(0, 600), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/pj"), new Vector2((1366 / 2) - (194 / 2), 950), new Point(194, 178), new Point(0, 0), new Point(0, 0), new Point(4, 0), new Vector2(0f, 0), 0f, 300, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (383 / 2), 1152), new Point(383, 97), new Point(0, 0), new Point(0, 274), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (324 / 2), 1152 + 120), new Point(324, 45), new Point(0, 0), new Point(0, 600), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/growlie"), new Vector2((1366 / 2) - (87 / 2), 1370), new Point(87, 88), new Point(0, 0), new Point(0, 0), new Point(3, 1), new Vector2(0f, 0), 0f, 500, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (375 / 2), 1470), new Point(375, 105), new Point(0, 0), new Point(0, 374), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (324 / 2), 1470 + 120), new Point(324, 45), new Point(0, 0), new Point(0, 600), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/kiel"), new Vector2((1366 / 2) - (180 / 2), 1670), new Point(180, 200), new Point(0, 0), new Point(0, 0), new Point(4, 1), new Vector2(0f, 0), 0f, 500, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (912 / 2), 1870), new Point(912, 121), new Point(0, 0), new Point(0, 479), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (498 / 2), 1870 + 120), new Point(498, 49), new Point(0, 0), new Point(0, 644), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (500 / 2), 1990 + 70), new Point(500, 50), new Point(0, 0), new Point(0, 692), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (626 / 2), 2060 + 70), new Point(626, 52), new Point(0, 0), new Point(0, 749), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); creditosList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/creditos"), new Vector2((1366 / 2) - (168 / 2), 2330), new Point(168, 174), new Point(0, 0), new Point(0, 809), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); }
//+++++++++++++++++++++++ INITIALIZE +++++++++++++++++ /// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { rnd = new Random(); texto = ""; tiempoMuertoKielTotal = 7000; estaEnSuSitio = false; kielMuertoSprite = false; tiempoMuertoKiel = 0; kielMuerto = false; tocaRayoKiel = false; tiempoTocaRayoKiel = 5000; currMouseState = Mouse.GetState(); lastMouseState = Mouse.GetState(); fondo = false; completoDelTo = false; tiempoFin = 0; collisionOffSet = Point.Zero; cayendo = false; tiempoLluvia = 0; densidadLluvia2 = 500; tiempoLluvia2 = 0; colision = 0; colisiond = 0; colisioni = 0; parada = 0; alturaTerreno = 4; jumpTimer = -10f; tiempoVelocidadSalto = 0; mundo1 = new Mundo(2.2f); currentDisparoState = DisparoState.Quieto; currentGravedadState = GravedadState.Aire; borrarBala = false; filas = 20; columnas = 0; count = 0; spriteList = new List<AutomatedSprite>(); kiel = new List<JefeFinal>(); disparoList = new List<Disparo>(); lluviaList = new List<Disparo>(); lluviaList2 = new List<Disparo>(); mapaList = new List<Mapa>(); terrenoList = new List<Mapa>(); terrenoList2 = new List<Mapa>(); terrenoListSuelo = new List<Mapa>(); fondoList1 = new List<Mapa>(); fondoList2 = new List<Mapa>(); map = new List<Point>(); disparoJefeList = new List<Mapa>(); jefeList = new List<Jefe>(); vidaList = new List<Mapa>(); vidaList2 = new List<Mapa>(); vidaListKiel = new List<Mapa>(); vidaList2Kiel = new List<Mapa>(); tigres = new List<Mapa>(); maxPosBloque = 0f; terrenoTiempoPasado = 0; terrenoDireccion = 0; terrenoDireccionAnterior = 4; terrenoTiempo = 100; temblorTerrenoTime = 0; temblorTerrenoElec = 0; temblorTerrenoNivel = 3; arrastre = 0; //Lluvia densidadLluvia = 500; //milisegundos entre mota velocidadLluvia = 6f; viento = -2; enemySpawnMinMilliseconds = 1000; enemySpawnMaxMilliseconds = 2000; enemyMinSpeed = 2; enemyMaxSpeed = 6; nextSpawnTime = 0; //Variables jefe respawnJefeMin = 0; respawnJefeMax = 1; //Posiciones posicionTerrenoX = 0; posicionTerrenoY = 700; posicionTerrenoBase = 0; posicionFondo1 = -1000; posicionFondo2 = -1000; //Disparo delayDisparo = 200; delayDisparoCurrent = 900; animaDisparo = 0; //Monsturo heridoDelayCurrent = 0; //Mapa cambioMapaDelay = 8000; cambioMapaDelayCurrent = 0; hastaMapa1 = 8000; hastaMapa2 = 15000; currentParteMapa = ParteMapa.Suelo; numFondo1 = 0; numFondo2 = 0; numTerreno1 = 0; capaTerreno = 0.5f; //Muerte caido = false; puntosControl = new List<float>(); puntoControl = 0; vidaPos = 0; vidaPosKiel = 0; tiempoHerido = 500f; tiempoMuerto = 0; muertoDelTo = false; for (int n = 0; n < 200; n++) map.Add(new Point(2, 0)); spriteBatch = new SpriteBatch(Game.GraphicsDevice); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); waveBank2 = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank 2.xwb"); soundBank2 = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank 2.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); ambientWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Ambient.xwb"); ambientBank = new SoundBank(audioEngine, @"Content\Sonidos\Ambient Bank.xsb"); musicCategory = audioEngine.GetCategory("Default"); musicCategory.SetVolume(0); //disparoJefeList.Add(new Mapa( // Game.Content.Load<Texture2D>(@"Images/DisparoJefe"), // new Vector2(kiel.getPlayerPosition.X + posxDisparoKiel, kiel.getPlayerPosition.Y), // new Point(0, 0), // new Point(200, 200), // new Point(0, 0), // new Point(4, 1), // new Vector2(0f, 0), // 0f, // 1000, 0.89f)); complete = new Mapa( Game.Content.Load<Texture2D>(@"Images/LevelComplete"), new Vector2(120, 120), new Point(1140, 496), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f); vidaList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPos += 7; for (int i = 0; i < 28; i++) { vidaList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(1, 0), new Point(1, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPos += 7; } vidaList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(2, 0), new Point(2, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPos = 0; vidaList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(0, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPos += 7; for (int i = 0; i < 28; i++) { vidaList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(1, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPos += 7; } vidaList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(2, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPos += 7; //Vida de kiel vidaListKiel.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSpriteKiel"), new Vector2(500 + vidaPosKiel, 30), new Point(10, 23), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPosKiel += 7; for (int i = 0; i < 98; i++) { vidaListKiel.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSpriteKiel"), new Vector2(500 + vidaPosKiel, 30), new Point(10, 23), new Point(0, 0), new Point(1, 0), new Point(1, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPosKiel += 7; } vidaListKiel.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSpriteKiel"), new Vector2(500 + vidaPosKiel, 30), new Point(10, 23), new Point(0, 0), new Point(2, 0), new Point(2, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPosKiel = 0; vidaList2Kiel.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSpriteKiel"), new Vector2(500 + vidaPosKiel, 30), new Point(10, 23), new Point(0, 0), new Point(0, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPosKiel += 7; for (int i = 0; i < 98; i++) { vidaList2Kiel.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSpriteKiel"), new Vector2(500 + vidaPosKiel, 30), new Point(10, 23), new Point(0, 0), new Point(1, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPosKiel += 7; } vidaList2Kiel.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSpriteKiel"), new Vector2(500 + vidaPosKiel, 30), new Point(10, 23), new Point(0, 0), new Point(2, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPosKiel += 7; player = new UserControlledSprite( Game.Content.Load<Texture2D>(@"Images/pj"), new Vector2((1366 / 2) - 152, 300), new Point(194, 178), new Point(collisionOffSet.X, collisionOffSet.Y), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 70, 0.80f, 30); pointer = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); reproducirMusica("kiel"); reproducirAmbiente("viento"); trackCue = soundBank.GetCue("caido"); trackCue2 = soundBank2.GetCue("bicho1"); //Suelo(-100, posicionTerrenoY, 0, -600, terrenoList); SueloGrande(0, posicionTerrenoY, 0, -100, terrenoList); SueloGrande(posicionTerrenoX + 1000, posicionTerrenoY, 0, 0, terrenoList); Escaleras(-400 , posicionTerrenoY - 200, 600, 0, 2, terrenoList2, 0.210f, true); kiel.Add(new JefeFinal( Game.Content.Load<Texture2D>(@"Images/kiel"), new Vector2(500, 20), new Point(180, 200), new Point(80, 30), new Point(0, 0), new Point(4, 2), new Vector2(5, 5), 0f, 400, 0.95f, 100)); final = new Mapa( Game.Content.Load<Texture2D>(@"Images/final"), new Vector2(posicionTerrenoX + 2000, posicionTerrenoY - 146), new Point(171, 156), new Point(0, 0), new Point(0, 1), new Point(4, 3), new Vector2(0f, 0), 0f, 200, 0.9f); posicionTerrenoX = 0; posicionTerrenoY = 0; //Escaleras(posicionTerrenoX + 600, posicionTerrenoY, 100, 10, 10, terrenoList2, 0.210f, true); //SegundoPlano(); foreach (Sprite s in terrenoList2) { s.getEscala = 0.8f; s.GetCollisionOffSet = new Point(60, 60); } puntuacionFuente = Game.Content.Load<SpriteFont>(@"Fuentes\fuente"); player.setTamAura = 300; foreach (Sprite s in jefeList) s.setTamAura = 400; }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { botones = new List<Boton>(); menu = new List<Mapa>(); seleccionados = new List<Boton>(); posicionFrameY = new int[3]; tamFrameX = new int[3]; tamFrameY = new int[3]; pulsados = new Boolean[6]; posicionBotonY = 450; posicionBotonX = 140; count = 0; posicionSeleccionado = 720; idBoton = 0; posicionFrameY[0] = 162+770; posicionFrameY[1] = 253+770; posicionFrameY[2] = 347+770; tamFrameX[0] = 46; tamFrameX[1] = 73; tamFrameX[2] = 73; tamFrameY[0] = 92; tamFrameY[1] = 92; tamFrameY[2] = 93; pointer = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); menu.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/selectMenu"), new Vector2(0, 0), new Point(1366, 700), new Point(0, 0), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0f) ); menu.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/selectMenu"), new Vector2(0, 700), new Point(1366, 700), new Point(0, 0), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0f)); for (int i = 0; i < 3; i++) { botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/selectMenu"), new Vector2(posicionBotonX, 276), new Point(160, 161), new Point(0, 0), new Point(0, 770), new Point(0, 770), Vector2.Zero, 0f, 1000, 0.2f) ); posicionBotonX += 463; } posicionBotonX = 191; for (int i = 0; i < 3; i++) { botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/selectMenu"), new Vector2(posicionBotonX, 305), new Point(tamFrameX[i], tamFrameY[i]), new Point(0, 0), new Point(0, posicionFrameY[i]), new Point(0, posicionFrameY[i]), Vector2.Zero, 0f, 1000, 0.3f) ); posicionBotonX += 460; } // TODO: Add your initialization code here base.Initialize(); spriteBatch = new SpriteBatch(Game.GraphicsDevice); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { currMouseStateLast = Mouse.GetState(); botones = new List<Boton>(); seleccionados = new List<Boton>(); posicionFrameY = new int[2]; tamFrameX = new int[2]; tamFrameY = new int[2]; posicionBotonY = 350; posicionBotonX = 500; count = 0; posicionSeleccionado = 720; idBoton = 0; pauseB = true; posicionFrameY[0] = 400; posicionFrameY[1] = 431; tamFrameX[0] = 143; tamFrameX[1] = 86; tamFrameY[0] = 30; tamFrameY[1] = 32; menu = new Mapa( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2((1366/2)-200, 150), new Point(400, 400), new Point(0, 0), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.12f); base.LoadContent(); pointer = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); for (int i = 0; i < 2; i++) { botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(posicionBotonX, posicionBotonY), new Point(tamFrameX[i], tamFrameY[i]), new Point(0, 0), new Point(0, posicionFrameY[i]), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.2f) ); posicionBotonX+= tamFrameX[i] + 100; } botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(550, 450), new Point(41, 32), new Point(0, 0), new Point(0, 495), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.11f) ); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(650, 450), new Point(49, 27), new Point(0, 0), new Point(0, 527), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.11f) ); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(600, 400), new Point(130, 32), new Point(0, 0), new Point(0, 463), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.11f) ); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(500, 300), new Point(159, 32), new Point(0, 0), new Point(0, 558), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.2f) ); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(670, 310), new Point(18, 15), new Point(0, 0), new Point(0, 613), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.2f) ); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/pause"), new Vector2(770, 307), new Point(20, 23), new Point(0, 0), new Point(0, 590), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.2f) ); // TODO: Add your initialization code here pulsados = new Boolean[botones.Count]; spriteBatch = new SpriteBatch(Game.GraphicsDevice); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); }
//+++++++++++++++++++++++ INITIALIZE +++++++++++++++++ /// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { rnd = new Random(); texto = ""; currMouseState = Mouse.GetState(); lastMouseState = Mouse.GetState(); fondo = false; completoDelTo = false; tiempoFin = 0; collisionOffSet = Point.Zero; tiempoLluvia = 0; colisiond = 0; colisioni = 0; parada = 0; alturaTerreno = 4; jumpTimer = -10f; tiempoVelocidadSalto = 0; mundo1 = new Mundo(2.2f); currentDisparoState = DisparoState.Quieto; currentGravedadState = GravedadState.Aire; borrarBala = false; spriteList = new List<AutomatedSprite>(); disparoList = new List<Disparo>(); lluviaList = new List<Disparo>(); mapaList = new List<Mapa>(); terrenoList = new List<Mapa>(); terrenoList2 = new List<Mapa>(); terrenoListSuelo = new List<Mapa>(); fondoList1 = new List<Mapa>(); fondoList2 = new List<Mapa>(); map = new List<Point>(); jefeList = new List<Jefe>(); vidaList = new List<Mapa>(); vidaList2 = new List<Mapa>(); tigres = new List<Mapa>(); maxPosBloque = 0f; terrenoTiempoPasado = 0; terrenoDireccion = 0; terrenoTiempo = 100; arrastre = 0; //Variables jefe respawnJefeMin = 0; respawnJefeMax = 1; //Posiciones posicionTerrenoX = 0; posicionTerrenoY = 700; posicionFondo1 = -1000; posicionFondo2 = -1000; //Disparo delayDisparo = 200; delayDisparoCurrent = 900; currentParteMapa = ParteMapa.Suelo; numFondo1 = 0; numFondo2 = 0; numTerreno1 = 0; capaTerreno = 0.5f; //Muerte caido = false; puntosControl = new List<float>(); puntoControl = 0; vidaPos = 0; tiempoHerido = 500f; tiempoMuerto = 0; muertoDelTo = false; for (int n = 0; n < 200; n++) map.Add(new Point(2, 0)); complete = new Mapa( Game.Content.Load<Texture2D>(@"Images/LevelComplete"), new Vector2(120, 120), new Point(1140, 496), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f); vidaList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPos += 7; for (int i = 0; i < 28; i++) { vidaList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(1, 0), new Point(1, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPos += 7; } vidaList.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(2, 0), new Point(2, 0), new Vector2(0f, 0), 0f, 1000, 0.89f)); vidaPos = 0; vidaList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(0, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPos += 7; for (int i = 0; i < 28; i++) { vidaList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(1, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPos += 7; } vidaList2.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/vidaSprite"), new Vector2(50 + vidaPos, 30), new Point(10, 23), new Point(0, 0), new Point(2, 1), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.99f)); vidaPos += 7; player = new UserControlledSprite( Game.Content.Load<Texture2D>(@"Images/pj"), new Vector2((1366 / 2) - 152, 164), new Point(194, 178), new Point(collisionOffSet.X, collisionOffSet.Y), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 70, 0.80f, 30); pointer = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); spriteBatch = new SpriteBatch(Game.GraphicsDevice); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); waveBank2 = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank 2.xwb"); soundBank2 = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank 2.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); ambientWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Ambient.xwb"); ambientBank = new SoundBank(audioEngine, @"Content\Sonidos\Ambient Bank.xsb"); musicCategory = audioEngine.GetCategory("Default"); musicCategory.SetVolume(0); reproducirMusica("ingame"); reproducirAmbiente("viento"); trackCue = soundBank.GetCue("caido"); Suelo(-100, posicionTerrenoY, 0, -600, terrenoList, 0.540f); SueloGrande(0, posicionTerrenoY, 0, 400, terrenoList, 0.530f); PuntoControlTigre(1366 / 2 - 15, posicionTerrenoY); puntosControl.Add(-(1366 / 2 - 15)); Suelo(posicionTerrenoX, posicionTerrenoY, 860, -120, terrenoList, 0.541f); texto = "Posicion escaleras X" + posicionTerrenoX + "Posicion escaleras Y" + posicionTerrenoY; Escaleras2(posicionTerrenoX-1000, posicionTerrenoY - 200, 500, 0, 9, terrenoList2, 0.300f, true); Suelo(posicionTerrenoX, posicionTerrenoY+300, 4500, -120, terrenoList, 0.542f); PuntoControlTigre(posicionTerrenoX + 350, posicionTerrenoY - tigres[0].getFrameSize.Y + 30); puntosControl.Add(-posicionTerrenoX + 350); Suelo(posicionTerrenoX, posicionTerrenoY+300, 1000, -120, terrenoList, 0.542f); PuntoControlTigre(posicionTerrenoX + 350, posicionTerrenoY - tigres[0].getFrameSize.Y + 30); puntosControl.Add(-posicionTerrenoX + 350); SueloChico(posicionTerrenoX, posicionTerrenoY, 800, -50, 0, terrenoList, 0.543f); SueloChico(posicionTerrenoX, posicionTerrenoY, 250, -50, 4, terrenoList, 0.543f); SueloChico(posicionTerrenoX, posicionTerrenoY, 250, -50, 3, terrenoList, 0.543f); SueloChico(posicionTerrenoX, posicionTerrenoY, 250, -50, 3, terrenoList, 0.543f); Suelo(posicionTerrenoX + 700, posicionTerrenoY + 100, 0, 0, terrenoList, 0.543f); Escaleras(posicionTerrenoX +700, posicionTerrenoY + 200, 100, 50, 9, terrenoList, 0.543f, true); Suelo(posicionTerrenoX + 700, posicionTerrenoY + 200, 0, 0, terrenoList, 0.543f); SueloChico(posicionTerrenoX, posicionTerrenoY - 50, 700, 0, 6, terrenoList, 0.543f); Suelo(posicionTerrenoX + 200, posicionTerrenoY +50, 0, 0, terrenoList, 0.543f); SueloChico(posicionTerrenoX, posicionTerrenoY - 50, 700, 0, 6, terrenoList, 0.543f); Suelo(posicionTerrenoX + 200, posicionTerrenoY + 50, 0, 0, terrenoList, 0.543f); SueloChico(posicionTerrenoX, posicionTerrenoY - 50, 700, 0, 6, terrenoList, 0.543f); Suelo(posicionTerrenoX + 200, posicionTerrenoY + 50, 0, 0, terrenoList, 0.543f); Escaleras(posicionTerrenoX + 2800, posicionTerrenoY, 100, 10, 20, terrenoList, 0.543f, false); final = new Mapa( Game.Content.Load<Texture2D>(@"Images/final"), new Vector2(posicionTerrenoX + 200, posicionTerrenoY - 146), new Point(171, 156), new Point(0, 0), new Point(0, 1), new Point(4, 3), new Vector2(0f, 0), 0f, 200, 0.9f); posicionTerrenoX = 0; posicionTerrenoY = 0; Suelo(posicionTerrenoX+6500, posicionTerrenoY+300, 0, 0, terrenoList2, 0.302f); Escaleras(posicionTerrenoX + 3000, posicionTerrenoY + 200, 100, 30, 15, terrenoList2, 0.302f, true); foreach (Sprite s in terrenoList2) { s.getEscala = 0.8f; s.GetCollisionOffSet = new Point(60, 60); } puntuacionFuente = Game.Content.Load<SpriteFont>(@"Fuentes\fuente"); player.setTamAura = 300; foreach (Sprite s in jefeList) s.setTamAura = 400; //base.Initialize(); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { botones = new List<Boton>(); seleccionados = new List<Boton>(); seguros = new List<Boton>(); posicionFrameY = new int[4]; tamFrameX = new int[4]; tamFrameY = new int[4]; posicionFrameYs = new int[4]; tamFrameXs = new int[4]; tamFrameYs = new int[4]; pulsados = new Boolean[4]; posicionBotonY = 276; posicionBotonX = 730; posicionSeleccionado = 720; direccion = 0; velocidad = 50; idBoton = 0; mostrarSeguro = false; posicionFrameY[0] = 1346; posicionFrameY[1] = 1375; posicionFrameY[2] = 1407; posicionFrameY[3] = 1443; tamFrameX[0] = 164; tamFrameX[1] = 234; tamFrameX[2] = 77; tamFrameX[3] = 177; tamFrameY[0] = 29; tamFrameY[1] = 31; tamFrameY[2] = 30; tamFrameY[3] = 35; posicionFrameYs[0] = 901; posicionFrameYs[1] = 991; posicionFrameYs[2] = 1125; posicionFrameYs[3] = 1254; tamFrameXs[0] = 504; tamFrameXs[1] = 434; tamFrameXs[2] = 543; tamFrameXs[3] = 202; tamFrameYs[0] = 90; tamFrameYs[1] = 134; tamFrameYs[2] = 129; tamFrameYs[3] = 92; menu = new Mapa( Game.Content.Load<Texture2D>(@"Images/menuSprite"), new Vector2(0, 0), new Point(1366, 768), new Point(0, 0), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0f); pointer = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); for (int i = 0; i < 4; i++) { botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/menuSprite"), new Vector2(1000, posicionBotonY), new Point(tamFrameX[i], tamFrameY[i]), new Point(0, posicionFrameY[i]), new Point(0, posicionFrameY[i]), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.1f) ); posicionBotonY += tamFrameY[i] + 30; } for (int i = 0; i < 4; i++) { seleccionados.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/menuSprite"), new Vector2(posicionBotonX, 85), new Point(tamFrameXs[i], tamFrameYs[i]), new Point(0, posicionFrameYs[i]), new Point(0, posicionFrameYs[i]), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.1f) ); posicionBotonX += tamFrameXs[i] + 300; } seguros.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/menuSprite"), new Vector2(525, 380), new Point(33,33), new Point(0,0), new Point(0, 1687), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.89f) ); seguros.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/menuSprite"), new Vector2(675, 380), new Point(51, 33), new Point(0, 0), new Point(0, 1720), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.89f) ); seguros.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/menuSprite"), new Vector2(450, 250), new Point(350, 210), new Point(0, 0), new Point(0, 1478), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.89f) ); // TODO: Add your initialization code here spriteBatch = new SpriteBatch(Game.GraphicsDevice); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); musicCategory = audioEngine.GetCategory("Default"); reproducirMusica("menu"); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { botones = new List<Boton>(); seleccionados = new List<Boton>(); posicionFrameY = new int[2]; tamFrameX = new int[2]; tamFrameY = new int[2]; pulsados = new Boolean[2]; posicionBotonY = 450; posicionBotonX = 540; count = 0; posicionSeleccionado = 720; idBoton = 0; posicionFrameY[0] = 768; posicionFrameY[1] = 805; tamFrameX[0] = 41; tamFrameX[1] = 225; tamFrameY[0] = 37; tamFrameY[1] = 38; menu = new Mapa( Game.Content.Load<Texture2D>(@"Images/gameover"), new Vector2(0, 0), new Point(1366, 768), new Point(0, 0), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0f); pointer = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); for (int i = 0; i < 2; i++) { botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/gameover"), new Vector2(posicionBotonX, posicionBotonY), new Point(tamFrameX[i], tamFrameY[i]), new Point(0, posicionFrameY[i]), new Point(0, posicionFrameY[i]), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.2f) ); posicionBotonX+= tamFrameX[i] + 100; } // TODO: Add your initialization code here spriteBatch = new SpriteBatch(Game.GraphicsDevice); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); }
public override void Initialize() { spriteBatch = new SpriteBatch(Game.GraphicsDevice); botones = new List<Boton>(); imagenes = new List<Mapa>(); audioEngine = new AudioEngine(@"Content\Sonidos\sonidos.xgs"); waveBank = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank.xwb"); soundBank = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank.xsb"); waveBank2 = new WaveBank(audioEngine, @"Content\Sonidos\Wave Bank 2.xwb"); soundBank2 = new SoundBank(audioEngine, @"Content\Sonidos\Sound Bank 2.xsb"); musicaWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Music.xwb"); musicaBank = new SoundBank(audioEngine, @"Content\Sonidos\Music Bank.xsb"); ambientWave = new WaveBank(audioEngine, @"Content\Sonidos\Wave Ambient.xwb"); ambientBank = new SoundBank(audioEngine, @"Content\Sonidos\Ambient Bank.xsb"); musicCategory = audioEngine.GetCategory("Default"); musicCategory.SetVolume(0); reproducirMusica("batidora"); puntero = new StaticSprite( Game.Content.Load<Texture2D>(@"Images/cursor"), new Vector2(0, 0), new Point(24, 28), new Point(5, 5), new Point(0, 0), new Point(0, 0), Vector2.Zero, 0f, 1000, 0.9f); imagenes.Add(new Mapa( Game.Content.Load<Texture2D>(@"Images/configuracion"), new Vector2(0, 0), new Point(1366, 768), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.1f)); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/configuracion"), new Vector2(35, 679), new Point(182, 53), new Point(0, 0), new Point(0, 796), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.2f)); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/configuracion"), new Vector2(263, 152), new Point(17, 6), new Point(0, 0), new Point(0, 768), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.2f)); botones.Add(new Boton( Game.Content.Load<Texture2D>(@"Images/configuracion"), new Vector2(292, 146), new Point(18, 18), new Point(0, 0), new Point(0, 775), new Point(0, 0), new Vector2(0f, 0), 0f, 1000, 0.2f)); pulsados = new Boolean[botones.Count]; }