Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            TextureLibrary.LoadContent(Content, "Textures");
            TextureLibrary.Initialise(GraphicsDevice);
            Explosion.InitialiseIndexes();

            debugText = Content.Load <SpriteFont>("Text/Debug");
            menuText  = Content.Load <SpriteFont>("Text/Menu");

            SoundEffectLibrary.LoadContent(Content, "SoundEffects");

            m_drawer               = new GameboyDrawer(this);
            GameCamera             = new Camera2D(new Vector2(GameboyWidth * 0.5f, GameboyHeight * 0.5f));
            GameCamera.ScaleToZoom = true;

            // Totem
            //

            //LoadLevel(1);
            //totems[0] = new Totem();
            ////testTotem.BuildFromFile("Level1_p1");
            //totems[0].AddSections(new SectionData(typeof(NormalSection), 0, 0, 30));
            //totems[0].AddSections(new SectionData(typeof(MetalSection), 10, 10, 7));
            //totems[0].AddSections(new SectionData(typeof(SpikeSection), 4, 4, 7));
            //totems[0].BuildRandom();
            //totems[0].Transform.PosX = 100;


            // Player initialisation
            //
            player = new Player();

            // Pause screen & GUI initialisation
            //
            menuScreen        = new MenuScreen();
            pauseScreen       = new PauseScreen();
            startingCountdown = new Countdown();
            scoreBorder       = new ScoreBorder();
            mapBorder         = new MapBorder();
            comboCounter      = new ComboCounter(player);
            scoreDisplay      = new ScoreDisplay();

            // Background textures
            //
            m_falaise                = new Sprite(this, TextureLibrary.GetSpriteSheet("decors_sol_falaise"), new Transform());
            m_falaise.Origin         = new Vector2(0, 0.32f);
            m_falaise.Transform.PosX = -235;
            m_falaise.Transform.PosY = 8;

            // Sound & musics
            //
            normalTotemCollisionSound_Channel1        = SoundEffectLibrary.Get("normal_collision_sound").CreateInstance();
            normalTotemCollisionSound_Channel1.Volume = 0.6f;
            normalTotemCollisionSound_Channel2        = SoundEffectLibrary.Get("normal_collision_sound").CreateInstance();
            normalTotemCollisionSound_Channel2.Volume = 0.6f;
            metalTotemCollisionSound_Channel1         = SoundEffectLibrary.Get("metal_collision_sound").CreateInstance();
            metalTotemCollisionSound_Channel2         = SoundEffectLibrary.Get("metal_collision_sound").CreateInstance();

            swordSlashSound             = SoundEffectLibrary.Get("sword_slash").CreateInstance();
            moveLeftToRightSound        = SoundEffectLibrary.Get("move_left_to_right").CreateInstance();
            moveLeftToRightSound.Volume = 0.6f;
            moveRightToLeftSound        = SoundEffectLibrary.Get("move_right_to_left").CreateInstance();
            moveRightToLeftSound.Volume = 0.6f;
            spikeHitSound      = SoundEffectLibrary.Get("spike_hit").CreateInstance();
            groundImpact       = SoundEffectLibrary.Get("ground_slam").CreateInstance();
            footsteps          = SoundEffectLibrary.Get("footsteps").CreateInstance();
            footsteps.IsLooped = true;
            menuMusic          = SoundEffectLibrary.Get("music_menu").CreateInstance();
            successJingle      = SoundEffectLibrary.Get("success_jingle").CreateInstance();

            feedback_powerUp            = SoundEffectLibrary.Get("feedback_powerup").CreateInstance();
            feedback_combo3             = SoundEffectLibrary.Get("feedback_combo3").CreateInstance();
            feedback_combo3.Volume      = 0.2f;
            feedback_combo6             = SoundEffectLibrary.Get("feedback_combo6").CreateInstance();
            feedback_combo6.Volume      = 0.3f;
            feedback_combo9             = SoundEffectLibrary.Get("feedback_combo9").CreateInstance();
            feedback_combo9.Volume      = 0.4f;
            feedback_comboBreaker       = SoundEffectLibrary.Get("feedback_comboBreaker").CreateInstance();
            feedbackLock                = true;
            isComboBreakerSoundPossible = false;

            musicT4P1L1 = SoundEffectLibrary.Get("music_T4P1L1").CreateInstance();
            musicT4P1L2 = SoundEffectLibrary.Get("music_T4P1L2").CreateInstance();
            musicT4P1L3 = SoundEffectLibrary.Get("music_T4P1L3").CreateInstance();
            musicT4P1L4 = SoundEffectLibrary.Get("music_T4P1L4").CreateInstance();

            musicT4P2L1 = SoundEffectLibrary.Get("music_T4P2L1").CreateInstance();
            musicT4P2L2 = SoundEffectLibrary.Get("music_T4P2L2").CreateInstance();
            musicT4P2L3 = SoundEffectLibrary.Get("music_T4P2L3").CreateInstance();
            musicT4P2L4 = SoundEffectLibrary.Get("music_T4P2L4").CreateInstance();

            musicT4P3L1 = SoundEffectLibrary.Get("music_T4P3L1").CreateInstance();
            musicT4P3L2 = SoundEffectLibrary.Get("music_T4P3L2").CreateInstance();
            musicT4P3L3 = SoundEffectLibrary.Get("music_T4P3L3").CreateInstance();
            musicT4P3L4 = SoundEffectLibrary.Get("music_T4P3L4").CreateInstance();

            //dynamicMusic = new DynamicMusic(musicT1P1L1, musicT1P1L2, musicT1P1L3, musicT1P1L4);
            //dynamicMusic = new DynamicMusic(musicT1P2L1, musicT1P2L2, musicT1P2L3, musicT1P2L4);
            //dynamicMusic = new DynamicMusic(musicT4P2L1, musicT4P2L2, musicT4P2L3, musicT4P2L4);
            //dynamicMusic = new DynamicMusic(musicT4P3L1, musicT4P3L2, musicT4P3L3, musicT4P3L4);
            //Foule et joueur porté
            Cutscenes.Initalise();
            Cutscenes.Intro();
            SetupNextLevel();
        }
Пример #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            TextureLibrary.LoadContent(Content, "Textures");
            TextureLibrary.Initialise(GraphicsDevice);
            Explosion.InitialiseIndexes();

            debugText = Content.Load<SpriteFont>("Text/Debug");
            menuText = Content.Load<SpriteFont>("Text/Menu");

            SoundEffectLibrary.LoadContent(Content, "SoundEffects");

            m_drawer = new GameboyDrawer(this);
            GameCamera = new Camera2D(new Vector2(GameboyWidth * 0.5f, GameboyHeight * 0.5f));
            GameCamera.ScaleToZoom = true;

            // Totem
            //

            //LoadLevel(1);
            //totems[0] = new Totem();
            ////testTotem.BuildFromFile("Level1_p1");
            //totems[0].AddSections(new SectionData(typeof(NormalSection), 0, 0, 30));
            //totems[0].AddSections(new SectionData(typeof(MetalSection), 10, 10, 7));
            //totems[0].AddSections(new SectionData(typeof(SpikeSection), 4, 4, 7));
            //totems[0].BuildRandom();
            //totems[0].Transform.PosX = 100;

            // Player initialisation
            //
            player = new Player();

            // Pause screen & GUI initialisation
            //
            menuScreen = new MenuScreen();
            pauseScreen = new PauseScreen();
            startingCountdown = new Countdown();
            scoreBorder = new ScoreBorder();
            mapBorder = new MapBorder();
            comboCounter = new ComboCounter(player);
            scoreDisplay = new ScoreDisplay();

            // Background textures
            //
            m_falaise = new Sprite(this, TextureLibrary.GetSpriteSheet("decors_sol_falaise"), new Transform());
            m_falaise.Origin = new Vector2(0, 0.32f);
            m_falaise.Transform.PosX = -235;
            m_falaise.Transform.PosY = 8;

            // Sound & musics
            //
            normalTotemCollisionSound_Channel1 = SoundEffectLibrary.Get("normal_collision_sound").CreateInstance();
            normalTotemCollisionSound_Channel1.Volume = 0.6f;
            normalTotemCollisionSound_Channel2 = SoundEffectLibrary.Get("normal_collision_sound").CreateInstance();
            normalTotemCollisionSound_Channel2.Volume = 0.6f;
            metalTotemCollisionSound_Channel1 = SoundEffectLibrary.Get("metal_collision_sound").CreateInstance();
            metalTotemCollisionSound_Channel2 = SoundEffectLibrary.Get("metal_collision_sound").CreateInstance();

            swordSlashSound = SoundEffectLibrary.Get("sword_slash").CreateInstance();
            moveLeftToRightSound = SoundEffectLibrary.Get("move_left_to_right").CreateInstance();
            moveLeftToRightSound.Volume = 0.6f;
            moveRightToLeftSound = SoundEffectLibrary.Get("move_right_to_left").CreateInstance();
            moveRightToLeftSound.Volume = 0.6f;
            spikeHitSound = SoundEffectLibrary.Get("spike_hit").CreateInstance();
            groundImpact = SoundEffectLibrary.Get("ground_slam").CreateInstance();
            footsteps = SoundEffectLibrary.Get("footsteps").CreateInstance();
            footsteps.IsLooped = true;
            menuMusic = SoundEffectLibrary.Get("music_menu").CreateInstance();
            successJingle = SoundEffectLibrary.Get("success_jingle").CreateInstance();

            feedback_powerUp = SoundEffectLibrary.Get("feedback_powerup").CreateInstance();
            feedback_combo3 = SoundEffectLibrary.Get("feedback_combo3").CreateInstance();
            feedback_combo3.Volume = 0.2f;
            feedback_combo6 = SoundEffectLibrary.Get("feedback_combo6").CreateInstance();
            feedback_combo6.Volume = 0.3f;
            feedback_combo9 = SoundEffectLibrary.Get("feedback_combo9").CreateInstance();
            feedback_combo9.Volume = 0.4f;
            feedback_comboBreaker = SoundEffectLibrary.Get("feedback_comboBreaker").CreateInstance();
            feedbackLock = true;
            isComboBreakerSoundPossible = false;

            musicT4P1L1 = SoundEffectLibrary.Get("music_T4P1L1").CreateInstance();
            musicT4P1L2 = SoundEffectLibrary.Get("music_T4P1L2").CreateInstance();
            musicT4P1L3 = SoundEffectLibrary.Get("music_T4P1L3").CreateInstance();
            musicT4P1L4 = SoundEffectLibrary.Get("music_T4P1L4").CreateInstance();

            musicT4P2L1 = SoundEffectLibrary.Get("music_T4P2L1").CreateInstance();
            musicT4P2L2 = SoundEffectLibrary.Get("music_T4P2L2").CreateInstance();
            musicT4P2L3 = SoundEffectLibrary.Get("music_T4P2L3").CreateInstance();
            musicT4P2L4 = SoundEffectLibrary.Get("music_T4P2L4").CreateInstance();

            musicT4P3L1 = SoundEffectLibrary.Get("music_T4P3L1").CreateInstance();
            musicT4P3L2 = SoundEffectLibrary.Get("music_T4P3L2").CreateInstance();
            musicT4P3L3 = SoundEffectLibrary.Get("music_T4P3L3").CreateInstance();
            musicT4P3L4 = SoundEffectLibrary.Get("music_T4P3L4").CreateInstance();

            //dynamicMusic = new DynamicMusic(musicT1P1L1, musicT1P1L2, musicT1P1L3, musicT1P1L4);
            //dynamicMusic = new DynamicMusic(musicT1P2L1, musicT1P2L2, musicT1P2L3, musicT1P2L4);
            //dynamicMusic = new DynamicMusic(musicT4P2L1, musicT4P2L2, musicT4P2L3, musicT4P2L4);
            //dynamicMusic = new DynamicMusic(musicT4P3L1, musicT4P3L2, musicT4P3L3, musicT4P3L4);
            //Foule et joueur porté
            Cutscenes.Initalise();
            Cutscenes.Intro();
            SetupNextLevel();
        }