Ejemplo n.º 1
0
 public AudioManager(Game1 currentGame)
 {
     game = currentGame;
     engine = new AudioEngine("Content\\SFX\\SFX.xgs");
     soundBank = new SoundBank(engine, "Content\\SFX\\Sound Bank.xsb");
     waveBank = new WaveBank(engine, "Content\\SFX\\Wave Bank.xwb");
     fxCat = engine.GetCategory("SFX");
     fxCat.SetVolume(10f);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// AudioController Constructor.
        /// Initializes AudioEngine, SoundBank and WaveBank.
        /// </summary>
        private AudioController()
        {
            String path = System.Environment.CurrentDirectory;
            path = path.Replace(@"\bin\Debug", @"\Resources");

            audioEngine = new AudioEngine(path + @"\sound.xgs");
            WaveBank = new WaveBank(audioEngine, path + @"\Wave Bank.xwb");
            SoundBank = new SoundBank(audioEngine, path + @"\Sound Bank.xsb");

            NoteCategory = audioEngine.GetCategory("Notes");
            NoteCategory.SetVolume(3.0f);
            AudioCategory BackgroundCategory = audioEngine.GetCategory("Background sound");
            BackgroundCategory.SetVolume(2.0f);
        }
Ejemplo n.º 3
0
        private SoundManager(Game game, Func<Vector3> getListenerPosition, Func<Vector3> getListenerForward, Func<Vector3> getListenerUp)
            : base(game)
        {
            audioEngine = new AudioEngine(@"Content\Audio\GameAudio.xgs");
            waveBank = new WaveBank(audioEngine, @"Content\Audio\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, @"Content\Audio\Sound Bank.xsb");
            musicCategory = audioEngine.GetCategory("Default");
            volume = 10;
            musicCategory.SetVolume(volume);

            cuelist = new List<Cue>();
            BGMCuelist = new List<Cue>();

            updateListenerForward = getListenerForward;
            updateListenerUp = getListenerUp;
            updateListenerPosition = getListenerPosition;
            listener = new AudioListener();
        }
Ejemplo n.º 4
0
        public AudioManager()
        {
            engine = new AudioEngine("Content/Sound/XACT Sound File.xgs");
            waves = new WaveBank(engine, "Content/Sound/Wave Bank.xwb");
            sounds = new SoundBank(engine, "Content/Sound/Sound Bank.xsb");

            soundEffectCategory = engine.GetCategory("Sound Effect");
            soundEffectCategory.SetVolume(sfxVolume);

            backgroundMusicCategory = engine.GetCategory("Music");
            backgroundMusicCategory.SetVolume(backgroundVolume);

            //the default gun sound was much too loud, so I created its own category to set the
            //volume for only that sound
            gunshotCategory = engine.GetCategory("Gunshot");
            gunshotCategory.SetVolume(gunshotVolume);

            Cue startSplashMusic = sounds.GetCue("Drum n Bass D Coexistant");
            playFirstBackgroundMusic(startSplashMusic);
        }
        public MusicManager(float lightThreshold, float darkThreshold)
        {
            LightThreshold = lightThreshold;
              DarkThreshold = darkThreshold;

              audioEngine = new AudioEngine("Content/audio/test.xgs");
              waveBank = new WaveBank(audioEngine, "Content/audio/Wave Bank1.xwb");
              soundBank = new SoundBank(audioEngine, "Content/audio/Sound Bank.xsb");

              light = audioEngine.GetCategory("Light");
              dark = audioEngine.GetCategory("Dark");
              light2 = audioEngine.GetCategory("Light2");
              dark2 = audioEngine.GetCategory("Dark2");

              CurrentStage = 0;
              NextStage = 0;
              light.SetVolume(0.0f);
              dark.SetVolume(0.0f);
              light2.SetVolume(0.0f);
              dark2.SetVolume(0.0f);
        }
Ejemplo n.º 6
0
 public void Initialize(IServiceProvider serviceProvider,Options options)
 {
     popUpText = new DrawableText();
     content = new ContentManager(serviceProvider, "Data");
     popUpText.font = content.Load<SpriteFont>("Stuff\\Arial");
     popUpBG = content.Load<Texture2D>("Stuff\\popUpBG");
     popUpText.Text = "";
     popUpText.color = Color.White;
     this.options = options;
     options.MusicVolumeChanged += new MusicVolumeChangedEventHandler(options_MusicVolumeChanged);
     options.ResolutionChanged += new ResolutionChangedEventHandler(options_ResolutionChanged);
     audioEngine = new AudioEngine(GameConstants.AUDIO_PATH + "Music.xgs");
     waveBank = new WaveBank(audioEngine, GameConstants.AUDIO_PATH + "Music.xwb");
     soundBank = new SoundBank(audioEngine, GameConstants.AUDIO_PATH + "Music.xsb");
     menuCategory = audioEngine.GetCategory("Music");
     graphXPackCategory = menuCategory;
     menuCategory.SetVolume(options.MusicVolumeFloat);
     playList = FileManager.GetFileDictString(GameConstants.MENU_PLAYLIST);
     currentPlaylist = playList;
     oldVolume = options.MusicVolumeFloat;
     currentVolume = options.MusicVolumeFloat;
     currentCategory = menuCategory;
     CreatePopUpRectangle(options.Resolution);
 }
Ejemplo n.º 7
0
        public float ChangeVolume(AudioCategory category, float volume, bool increase, float maxVolume)
        {
            if (increase)
            {
                volume = MathHelper.Clamp(volume + 0.01f, 0.0f, maxVolume);
            }
            else
                volume = MathHelper.Clamp(volume - 0.01f, 0.0f, maxVolume);

            category.SetVolume(volume);
            return volume;
        }
Ejemplo n.º 8
0
        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));
        }
Ejemplo n.º 9
0
        ////////////////////////////////////////////////////////////////////////////////
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

              title_sprite = Content.Load<Texture2D> ("images/title_trans");
              title_yellow = Content.Load<Texture2D> ("images/title_yellow");
              title_green = Content.Load<Texture2D> ("images/title_green");
              title_blue = Content.Load<Texture2D> ("images/title_blue");
              title_red = Content.Load<Texture2D> ("images/title_red");
              title_orange = Content.Load<Texture2D> ("images/title_orange");
              menu_new_sprite = Content.Load<Texture2D> ("images/menu_newgame");
              menu_instruct_sprite = Content.Load<Texture2D> ("images/menu_instruct");
              menu_exit_sprite = Content.Load<Texture2D> ("images/menu_exit");
              menu_resume_sprite = Content.Load<Texture2D> ("images/menu_resume");
              ng_sprite = Content.Load<Texture2D> ("images/ng");
              menu_credits_sprite = Content.Load<Texture2D> ("images/credits_sprite2");
              bg1 = Content.Load<Texture2D> ("images/bg1c");
              bg2 = Content.Load<Texture2D> ("images/bg2");
              bg3 = Content.Load<Texture2D> ("images/bg3");
              bg4 = Content.Load<Texture2D> ("images/bg4");
              bg5 = Content.Load<Texture2D> ("images/bg5");
              bg6 = Content.Load<Texture2D> ("images/bg6");
              instructions1 = Content.Load<Texture2D> ("images/instructions1");
              instructions2 = Content.Load<Texture2D> ("images/instructions2");
              //instructions_blur = Content.Load<Texture2D> ("images/instructions_blur");
              credits_screen = Content.Load<Texture2D> ("images/credits7");
              chart_sprite = Content.Load<Texture2D> ("images/Chart1");
              chart_stuff_sprite = Content.Load<Texture2D> ("images/Chart2");
              wall_sprite = Content.Load<Texture2D> ("images/Walls");
              conveyor_sprite = Content.Load<Texture2D> ("images/Conveyor");
              grabber_sprite = Content.Load<Texture2D> ("images/Grabber");
              lightning_sprite = Content.Load<Texture2D> ("images/Lightning");
              frame_sprite = Content.Load<Texture2D> ("images/Frame3");
              block_sprite = Content.Load<Texture2D> ("images/Blocks");
              big_purple_sprite = Content.Load<Texture2D> ("images/bigpurple");
              rainbow_sprite = Content.Load<Texture2D> ("images/Rainbow");
              box_sprite = Content.Load<Texture2D> ("images/Box2");
              box_newgame_sprite = Content.Load<Texture2D> ("images/box_newgame");
              box_difficulty_sprite = Content.Load<Texture2D> ("images/box_difficulty");
              box_menu_sprite = Content.Load<Texture2D> ("images/box_menu");
              box_sound_sprite = Content.Load<Texture2D> ("images/box_sound");
              box_on_sprite = Content.Load<Texture2D> ("images/box_on");
              box_off_sprite = Content.Load<Texture2D> ("images/box_off");
              box_music_sprite = Content.Load<Texture2D> ("images/box_music");
              box_on2_sprite = Content.Load<Texture2D> ("images/box_on2");
              box_off2_sprite = Content.Load<Texture2D> ("images/box_off2");
              box_1_sprite = Content.Load<Texture2D> ("images/box_1");
              box_2_sprite = Content.Load<Texture2D> ("images/box_2");
              box_3_sprite = Content.Load<Texture2D> ("images/box_3");
              box_4_sprite = Content.Load<Texture2D> ("images/box_4");
              box_5_sprite = Content.Load<Texture2D> ("images/box_5");
              box_6_sprite = Content.Load<Texture2D> ("images/box_6");
              box_7_sprite = Content.Load<Texture2D> ("images/box_7");
              box_8_sprite = Content.Load<Texture2D> ("images/box_8");
              box_9_sprite = Content.Load<Texture2D> ("images/box_9");
              box_10_sprite = Content.Load<Texture2D> ("images/box_10");
              box_height_sprite = Content.Load<Texture2D> ("images/box_height");
              box_exit_sprite = Content.Load<Texture2D> ("images/box_exit");
              box_timer_sprite = Content.Load<Texture2D> ("images/box_timer");
              timer_0_sprite = Content.Load<Texture2D> ("images/timer_0");
              timer_1_sprite = Content.Load<Texture2D> ("images/timer_1");
              timer_2_sprite = Content.Load<Texture2D> ("images/timer_2");
              timer_3_sprite = Content.Load<Texture2D> ("images/timer_3");
              timer_4_sprite = Content.Load<Texture2D> ("images/timer_4");
              timer_5_sprite = Content.Load<Texture2D> ("images/timer_5");
              timer_6_sprite = Content.Load<Texture2D> ("images/timer_6");
              timer_7_sprite = Content.Load<Texture2D> ("images/timer_7");
              timer_8_sprite = Content.Load<Texture2D> ("images/timer_8");
              timer_9_sprite = Content.Load<Texture2D> ("images/timer_9");
              counter_0_sprite = Content.Load<Texture2D> ("images/counter_0");
              counter_1_sprite = Content.Load<Texture2D> ("images/counter_1");
              counter_2_sprite = Content.Load<Texture2D> ("images/counter_2");
              counter_3_sprite = Content.Load<Texture2D> ("images/counter_3");
              counter_4_sprite = Content.Load<Texture2D> ("images/counter_4");
              counter_5_sprite = Content.Load<Texture2D> ("images/counter_5");
              counter_6_sprite = Content.Load<Texture2D> ("images/counter_6");
              counter_7_sprite = Content.Load<Texture2D> ("images/counter_7");
              counter_8_sprite = Content.Load<Texture2D> ("images/counter_8");
              counter_9_sprite = Content.Load<Texture2D> ("images/counter_9");
              counter_label = Content.Load<Texture2D> ("images/blocksleft3");
              blockhead_logo_sprite = Content.Load<Texture2D> ("images/blockhead3");
              youwin_sprite = Content.Load<Texture2D> ("images/youwin");
              youlose_sprite = Content.Load<Texture2D> ("images/youlose");
              particle_red = Content.Load<Texture2D> ("images/particle_red");
              particle_orange = Content.Load<Texture2D> ("images/particle_orange");
              particle_yellow = Content.Load<Texture2D> ("images/particle_yellow");
              particle_green = Content.Load<Texture2D> ("images/particle_green");
              particle_blue = Content.Load<Texture2D> ("images/particle_blue");
              particle_purple = Content.Load<Texture2D> ("images/particle_purple");
              particle_white = Content.Load<Texture2D> ("images/particle_white");
              particle_grey = Content.Load<Texture2D> ("images/particle_grey");
              particle_black = Content.Load<Texture2D> ("images/particle_black");
              particle_smoke_sprite = Content.Load<Texture2D> ("images/particle_smoke");
              solid_black = Content.Load<Texture2D> ("images/solid_black");
              solid_white = Content.Load<Texture2D> ("images/solid_white");
              solid_red = Content.Load<Texture2D> ("images/solid_red");
              solid_orange = Content.Load<Texture2D> ("images/solid_orange");
              solid_yellow = Content.Load<Texture2D> ("images/solid_yellow");
              solid_green = Content.Load<Texture2D> ("images/solid_green");
              solid_blue = Content.Load<Texture2D> ("images/solid_blue");
              solid_purple = Content.Load<Texture2D> ("images/solid_purple");
              color_flash_sprite = Content.Load<Texture2D> ("images/solid_white");
              splash_sprite = Content.Load<Texture2D> ("images/splash2");
              intro_lightning1_sprite = Content.Load<Texture2D> ("images/lightning1a");
              intro_lightning2_sprite = Content.Load<Texture2D> ("images/lightning2");
              intro_lightning3_sprite = Content.Load<Texture2D> ("images/lightning3");
              credits_hypno = Content.Load<Texture2D> ("images/hypno3");
              demolition_sprite = Content.Load<Texture2D> ("images/demolition1c");

              title_bg_sprite = title_green;

              debug_font = Content.Load<SpriteFont>("Kooten");

              audioEngine = new AudioEngine("Content/blockhead_sound.xgs");
              waveBank = new WaveBank(audioEngine, "Content/Wave Bank.xwb");
              soundBank = new SoundBank(audioEngine, "Content/Sound Bank.xsb");

              sound_category = audioEngine.GetCategory("Default");
              music_category = audioEngine.GetCategory("Music");

              sound_category.SetVolume(sound_volume);
              music_category.SetVolume(music_volume);
        }
        //+++++++++++++++++++++++         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;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the Game class, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            backgroundTexture = content.Load<Texture2D>("SpaceBackground");

            audioEngine = new AudioEngine("Content\\soundProject.xgs");
            waveBankSFX = new WaveBank(audioEngine, "Content\\SFX.xwb");
            waveBankBGM = new WaveBank(audioEngine, "Content\\BGM.xwb", 0, 4);
            soundBank = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            audioEngine.Update();

            musicCategory = audioEngine.GetCategory("Music");

            musicCategory.SetVolume(OptionsMenuScreen.bgmVolume / 10);

            soundBank.GetCue("menubgm").Play();
        }
Ejemplo n.º 12
0
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            audioEngine = new AudioEngine("Content\\soundProject.xgs");
            waveBankSFX = new WaveBank(audioEngine, "Content\\SFX.xwb");
            waveBankBGM = new WaveBank(audioEngine, "Content\\BGM.xwb", 0, 4);
            soundBank = new SoundBank(audioEngine, "Content\\Sound Bank.xsb");

            audioEngine.Update();

            defaultCategory = audioEngine.GetCategory("Default");

            defaultCategory.SetVolume(OptionsMenuScreen.sfxVolume / 10);
        }
        //+++++++++++++++++++++++         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();
        }
Ejemplo n.º 14
0
 private void SetVolumeMainBGM()
 {
     soundCategory = audioEngine.GetCategory("Music");
     soundCategory.SetVolume(soundVolume);
     audioEngine.Update();
     SoundVolume.soundVolume = soundVolume;
 }
Ejemplo n.º 15
0
        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];
        }
Ejemplo n.º 16
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //parallaxLayers[0].TexturesDay = Content.Load<Texture2D>("Parallax\\City_Background");
            //parallaxLayers[0].TexturesDay = Content.Load<Texture2D>("Parallax\\Forest1_Background");

            //parallaxLayers[1].TexturesDay = Content.Load<Texture2D>("Parallax\\City_middleground");
            //parallaxLayers[1].TexturesDay = Content.Load<Texture2D>("Parallax\\Forground 1");

            //parallaxLayers[2].TexturesDay = Content.Load<Texture2D>("Parallax\\City_construction");
            //parallaxLayers[2].TexturesDay = Content.Load<Texture2D>("Parallax\\Forest1_foreground");

            parallaxLayers[0].TexturesDay = Content.Load<Texture2D>("Parallax\\MyCityBackground");
            parallaxLayers[0].TexturesDay = Content.Load<Texture2D>("Parallax\\Forest1_Background");
            parallaxLayers[0].TexturesDay = Content.Load<Texture2D>("Parallax\\Bridge - Image 3");

            parallaxLayers[1].TexturesDay = Content.Load<Texture2D>("Parallax\\City_construction");
            parallaxLayers[1].TexturesDay = Content.Load<Texture2D>("Parallax\\MyBlank");
            parallaxLayers[1].TexturesDay = Content.Load<Texture2D>("Parallax\\MyBlank");

            parallaxLayers[2].TexturesDay = Content.Load<Texture2D>("Parallax\\City_foreground");
            parallaxLayers[2].TexturesDay = Content.Load<Texture2D>("Parallax\\Forest1_foreground");
            parallaxLayers[2].TexturesDay = Content.Load<Texture2D>("Parallax\\Bridgelevel_foreground");

            nightOverlay = Content.Load<Texture2D>("Parallax\\Night_layer");

            audioEngine = new AudioEngine(Content.RootDirectory + "//Sound//DagOgNatt.xgs");

            waveBankBackground = new WaveBank(audioEngine, Content.RootDirectory + "//Sound//Background.xwb");
            waveBankSoundEffects = new WaveBank(audioEngine, Content.RootDirectory + "//Sound//SoundEffects.xwb");

            soundBankBackground = new SoundBank(audioEngine, Content.RootDirectory + "//Sound//Background.xsb");
            soundBankHeartBeat = new SoundBank(audioEngine, Content.RootDirectory + "//Sound//HeartBeat.xsb");
            soundBankMusic = new SoundBank(audioEngine, Content.RootDirectory + "//Sound//Music.xsb");
            soundBankSoundEffects = new SoundBank(audioEngine, Content.RootDirectory + "//Sound//SoundEffects.xsb");
            soundBankWalking = new SoundBank(audioEngine, Content.RootDirectory + "//Sound//Walking.xsb");

            ambiance = "ForestDusk";
            currentAmbiance = soundBankBackground.GetCue(ambiance);
            currentAmbiance.Play();

            walkingSound = soundBankWalking.GetCue("Walking");

            heartbeat = "HeartbeatForestDawn";
            currentHeartbeat = soundBankHeartBeat.GetCue(heartbeat);
            heartbeatCategory = audioEngine.GetCategory("Heartbeat");
            heartbeatCategory.SetVolume(0.2f);

            dogBark = soundBankSoundEffects.GetCue("MonsterWolfBark");
            soundEffectsCategory = audioEngine.GetCategory("SoundEffects");
            soundEffectsCategory.SetVolume(0.2f);

            //player.Texture = Content.Load<Texture2D>("Player\\Walk0000");
            player.Texture = Content.Load<Texture2D>("Player\\WalkLoopSheet_05");

            //startButton.TextureDay = Content.Load<Texture2D>("Start Game Btn Large size");
            startScreen.TextureDay = Content.Load<Texture2D>("StartScreen");

            player.TextureDie = Content.Load<Texture2D>("Player\\deathAnimation");

            gate.TextureDay = Content.Load<Texture2D>("Gate");

            excavator.TextureDay = Content.Load<Texture2D>("Plant");
            //excavator.Song = Content.Load<Song>("Song\\excavator");

            monster.TextureDay = Content.Load<Texture2D>("UlvMonsterHode_Spritesheet5x5");

            pulse.TextureDay = Content.Load<Texture2D>("Hjertebank");

            score.TextureDay = Content.Load<Texture2D>("SolUI");
            bushCan.TextureDay = Content.Load<Texture2D>("Kanne i busk");

            numbOne.TextureDay = Content.Load<Texture2D>("numbers");
            flower.TextureDay = Content.Load<Texture2D>("Flower_01");
            flower.TextureNight = Content.Load<Texture2D>("Flower_02");
            doneFlower.TextureDay = Content.Load<Texture2D>("Flower_03");

            //heartbeat = Content.Load<Song>("Song\\Heartbeat");

            player.TextureRun = Content.Load<Texture2D>("Player\\RunLoopSheet_02");
            bridge.TextureDay = Content.Load<Texture2D>("Parallax\\Bridge_night");
            player.TextureCan = Content.Load<Texture2D>("WaterCanWalkSheet_01");
            player.TextureWatering = Content.Load<Texture2D>("PouringSheet_01");

            wolf.TextureDay = Content.Load<Texture2D>("Image 2_Wolf_day");
            wolf.TextureNight = Content.Load<Texture2D>("Image 2_Wolf_night");

            //  dayOne = Content.Load<Song>("Song\\music.full.dawn");
            // nightOne = Content.Load<Song>("Song\\music.full.dusk");
            //MediaPlayer.IsRepeating = true;
            //MediaPlayer.Volume = 0.3f;
            //MediaPlayer.Play(heartbeat);

            Mouse.WindowHandle = this.Window.Handle;
            mouseTexture = Content.Load<Texture2D>("Cursor_v03");

            // Menu button events
            menuButtons[0].TextureDay = Content.Load<Texture2D>("StartGameButtonSmallSize");
            menuButtons[0].clicked += new Button.EventHandler(ButtonClicked);

            menuButtons[1].TextureDay = Content.Load<Texture2D>("StartGameButtonSmallSize");
            menuButtons[1].clicked += new Button.EventHandler(ButtonClicked);
        }
Ejemplo n.º 17
0
 private void SetVolumeMainSE()
 {
     soundCategory2 = audioEngine.GetCategory("Default");
     soundCategory2.SetVolume(soundVolume2);
     audioEngine.Update();
     SoundVolumeSE.soundVolumeSE = soundVolume2;
 }