Example #1
0
        public override void Load()
        {
            if (!isHighLvl)
            {
                LoadMapData(1, "Stages\\Stage2_Easy.txt", 0, 0);
                SoundControl.IniMusic("Audio\\BGM\\cave", true);
            }
            else
            {
                LoadMapData(1, "Stages\\Stage2_Hard.txt", 0, 0);
                SoundControl.IniMusic("Audio\\BGM\\ice", true);
            } SoundControl.musicInstance.IsLooped = true;

            player = new Player(this, 100, 100, 48, 48, 10);
            characters.Add(player);
            sword = player.sword;
            weapons.Add(sword);
            boss = new Fuujin(this, 14500, 100, 380, 310, 70, 0, 0, 1);//210, 210
            characters.Add(boss);

            SetTerrainDirection();
            SetWaterDirection();
            AddObjects();
            base.Load();

            if (!game.isMuted)
            {
                SoundControl.Play();
            }
        }
Example #2
0
        public override void Update(double dt)
        {
            if (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8))     // To Next Stage
            {
                if (game.stageNum < Game1.maxStageNum)
                {
                    game.stageNum++;
                    game.hasReachedCheckPoint = false;
                    SoundControl.Stop();
                    game.ReloadStage(game.isHighLvl);
                    //SoundControl.Pause();//SoundControl.Stop();


                    isEndScene            = true;
                    upperScene.isEndScene = true;
                }
                else if (game.stageNum == Game1.maxStageNum && (form.IsDisposed || form == null))                    // To Ending
                {
                    game.stageNum             = 1;
                    game.hasReachedCheckPoint = false;
                    SoundControl.Stop();
                    PushScene(new Ending(this, true));
                }
            }

            counter++;
        }
Example #3
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);
            Object.Inicialize(this, spriteBatch, Content);
            SoundControl.Initialize(this, Content);
            Scene.Initialize(this, spriteBatch, Content);
            // TODO: use this.content to load your game content here
            PushScene(new MainTitle(null));
            //EvaluateScore("Ranking.txt");
            LoadRanking("Ranking.txt", false, "Ranking.txt");            //"Ranking_original.txt");

            // Fonts
            titleFont    = Content.Load <SpriteFont>("General\\titleFont");
            menuFont     = Content.Load <SpriteFont>("General\\menuFont");
            debugFont    = Content.Load <SpriteFont>("General\\debugFont");
            pumpDemi     = Content.Load <SpriteFont>("General\\Pump_Demi_Bold");
            japaneseFont = Content.Load <SpriteFont>("General\\japaneseFont");
            dm           = new DebugMessage(this, spriteBatch);
            dm.Initialize();

            // Audio

            /*audioEngine = new AudioEngine("Content\\Audio\\Audio.xgs");
             * waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
             * soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");*/
        }
Example #4
0
        public override void Update(double dt)
        {
            if (counter < logoDisplayTime)
            {
                if (JoyStick.IsOnKeyDown(8) || JoyStick.IsOnKeyDown(1))
                {
                    SkipLogo();
                }
            }
            else
            {
                if (counter == logoDisplayTime)
                {
                    if (!game.isMuted)
                    {
                        SoundControl.Play();
                    }
                    hasDisplayed = true;
                }

#if DEBUG
                Debug();
#endif
                if (JoyStick.IsOnKeyDown(8) || JoyStick.IsOnKeyDown(1))
                {
                    PushScene(new MainMenu(this));
                    if (!game.isMuted)
                    {
                        choose.Play(SoundControl.volumeAll, 0f, 0f);
                    }
                    counter = 0;
                }
            }
            counter++;
        }
Example #5
0
 private void BackToLogo()
 {
     if (hasDisplayed)
     {
         counter      = 0;
         hasDisplayed = false;
         SoundControl.Stop();
     }
 }
Example #6
0
        protected override void ButtonUpdate()
        {
            if (button[0].isSelected && (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8)))           // Continue
            {
                SoundControl.Stop();
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }


                //SoundControl.Pause();//SoundControl.Stop();
                //isEndScene = true;
                nowLoading = true;
            }
            if (button[1].isSelected && (JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(8)))           // Back to Menu
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                SoundControl.Stop();
                SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
                //isEndScene = true;

                //BackScene(game.stageNum + 4);//5
                game.hasReachedCheckPoint = false;
                game.tmpGameStatus        = new GameStatus();
                game.InitializeStack();
            }
            if ((!game.twoButtonMode && JoyStick.KEY(2) || game.twoButtonMode && JoyStick.KEY(5)) && game.avilityNum == 0)
            {
                if ((upperScene as Stage).reverse.ReduceTAS() != 0)
                {
                    SoundControl.Stop();
                    SoundControl.RestoreMusic();
                    SoundControl.Resume();
                    if (!game.isMuted)
                    {
                        (upperScene as Stage).reverse.PlaySound();
                    }
                    isEndScene = true;
                    (upperScene as Stage).player.isAlive         = true;
                    (upperScene as Stage).toGameOver             = false;
                    (upperScene as Stage).hasEffectedPlayerDeath = false;
                    (upperScene as Stage).reverse.StartReverse();
                    (upperScene as Stage).ResetDeathEffect();
                }
            }

            if (hasDisplayed)
            {
                game.ReloadStage(game.isHighLvl);
                isEndScene = true;
            }
        }
Example #7
0
        public override void Load()
        {
            base.Load();
            button[0].texture = content.Load <Texture2D>("General\\Menu\\Option");
            SoundControl.Stop();
            SoundControl.IniMusic("Audio//BGM//menu-b", true);
            SoundControl.Play();

            CONTEXT_POSITION = new Vector2(0, Game1.Height - game.japaneseFont.MeasureString("あ").Y);
        }
Example #8
0
        public override void Load()
        {
            for (int i = 0; i < textureNum; i++)
            {
                textures[i] = content.Load <Texture2D>("General\\Credit\\SC0" + (i + 1).ToString());
            }

            SoundControl.IniMusic("Audio\\BGM\\ending_medley_newnew", false);
            if (!game.isMuted)
            {
                SoundControl.Play();
            }
        }
Example #9
0
        public override void Load()
        {
            base.Load();

            for (int i = 0; i < buttonNum; i++)
            {
                button[i].texture = content.Load <Texture2D>("General\\Menu\\GameOver" + i);
            }

            SoundControl.IniMusic("Audio\\BGM\\gameover", false);
            if (!game.isMuted)
            {
                SoundControl.Play();
            }
        }
Example #10
0
        protected override void ButtonUpdate()
        {
            base.ButtonUpdate();



            if (button[0].isSelected && JoyStick.IsOnKeyDown(1))  // reverse
            {
                if (!game.isMuted)
                {
                    start.Play(SoundControl.volumeAll, 0f, 0f);
                }
                //game.stageNum = 1; // StageSelectでstageNumを変えるため
                game.avilityNum = 0;
                SoundControl.Stop();
                nowLoading = true;
                //game.ReloadStage(game.isHighLvl);
                //PushStage();
            }
            if (button[1].isSelected && JoyStick.IsOnKeyDown(1))  // slow
            {
                if (!game.isMuted)
                {
                    start.Play(SoundControl.volumeAll, 0f, 0f);
                }
                //game.stageNum = 1;
                game.avilityNum = 1;
                SoundControl.Stop();
                nowLoading = true;
                //PushStage(); //PushScene(new Stage1(this, game.isHighLvl));
            }
            if (button[2].isSelected && JoyStick.IsOnKeyDown(1))  // accel
            {
                if (!game.isMuted)
                {
                    start.Play(SoundControl.volumeAll, 0f, 0f);
                }
                //game.stageNum = 1;
                game.avilityNum = 2;
                nowLoading      = true;
                SoundControl.Stop();
                //PushStage(); //PushScene(new Stage1(this, game.isHighLvl));
            }
            if (hasDisplayed)
            {
                PushStage();
            }
        }
Example #11
0
        public override void Load()
        {
            texture[0] = content.Load <Texture2D>("General\\Menu\\TitleBG");
            texture[1] = content.Load <Texture2D>("General\\OP\\OP0");
            string t = rnd.Next(1, 2).ToString();

            texture[2] = content.Load <Texture2D>("General\\OP\\OP" + t);
            if (game.random.Next(1, 20) == 1)
            {
                texture[2] = content.Load <Texture2D>("General\\OP\\OP3");
            }
            texture[3] = content.Load <Texture2D>("General\\Menu\\PushStart");

            SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
            KeyConfig.LoadXML("KeyConfig", "Xml\\KeyConfig.xml");
        }
Example #12
0
        public override void Load()
        {
            if (!isHighLvl)
            {
                LoadMapData(1, "Stages\\Stage3_Easy.txt", 0, 0);
            }
            else
            {
                LoadMapData(1, "Stages\\Stage3_Hard.txt", 0, 0);
            }

            player = new Player(this, 100, 100, 48, 48, 10);
            characters.Add(player);
            sword = player.sword;
            weapons.Add(sword);
            staticTerrains.Add(new Block(this, 100, 200, 32, 32));
            boss = new Rival(this, 15000, 300, 60, 60, game.isHighLvl ? 50 : 40, 0, 1, 1);
            characters.Add(boss);
            AddObjects();

            SetTerrainDirection();
            SetWaterDirection();

            base.Load();
            foreach (Weapon weapon in weapons)
            {
                if (weapon is Turret)
                {
                    weapon.Load(game.Content, "Object\\Turret&Bullet" + "\\" + "windTurret2");
                }
            }

            if (!game.isHighLvl)
            {
                SoundControl.IniMusic("Audio\\BGM\\machine", true);
            }
            else
            {
                SoundControl.IniMusic("Audio\\BGM\\boss", true);
            } SoundControl.musicInstance.IsLooped = true;
            if (!game.isMuted)
            {
                SoundControl.Play();
            }
        }
Example #13
0
        public override void Load()
        {
            base.Load();

            button[0].texture = content.Load <Texture2D>("General\\Menu\\StageClear");
            SoundControl.IniMusic("Audio\\BGM\\clear", false);
            if (!game.isMuted)
            {
                SoundControl.Play();
            }

            // Scoreをcastして確定
            this.scoreToDisplay = (int)game.stageScores[game.stageNum - 1];
            if (game.stageNum == 3)
            {
                form = new WinControl(game);
                form.Show();
            }
        }
Example #14
0
        public override void Load()
        {
            if (!isHighLvl)
            {
                LoadMapData(1, "Stages\\Stage1_Easy.txt", 0, 0);
                boss = new Raijin(this, 14000, 100, 300, 280, 50);                // (210, 210) (300, 280)
                characters.Add(boss);
            }
            else
            {
                LoadMapData(1, "Stages\\Stage1_Hard.txt", 0, 0);
                boss = new Raijin(this, 14300, 100, 300, 280, 50);
                characters.Add(boss);
            }
            SetTerrainDirection();
            SetWaterDirection();

            player = new Player(this, 100, 100, 48, 48, 10);
            characters.Add(player);
            sword = player.sword;
            weapons.Add(sword);
            AddObjects();

            base.Load();
            foreach (Weapon weapon in weapons)
            {
                if (weapon is Turret)
                {
                    weapon.Load(game.Content, "Object\\Turret&Bullet" + "\\" + "windTurret2");
                }
            }

            SoundControl.Stop();
            SoundControl.IniMusic("Audio\\BGM\\forest", true);
            SoundControl.musicInstance.IsLooped = true;
            if (!game.isMuted)
            {
                SoundControl.Play();
            }
        }
Example #15
0
 public override void Update(double dt)
 {
     if (!timer.IsStarted)
     {
         timer.Start();
     }
     if (timer.TotalTime() > (float)timings.Last() || JoyStick.IsOnKeyDown(1))
     {
         SoundControl.Stop();
         SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
         //BackScene(5);
         if (fromGame)
         {
             game.InitializeStack();
             //BackScene(8);
         }
         else
         {
             isEndScene = true;
         }
     }
 }
Example #16
0
        protected override void ButtonUpdate()
        {
            if (JoyStick.IsOnKeyDown(2) || JoyStick.IsOnKeyDown(3))
            {
                isEndScene = true;
                if (!game.isMuted)
                {
                    cancel.Play(SoundControl.volumeAll, 0f, 0f);
                }
                SoundControl.Stop();
                SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
            }

            if (button[0].isSelected && JoyStick.IsOnKeyDown(1))
            {
                PushScene(new LvlSelect(this));
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }
            if (button[1].isSelected && JoyStick.IsOnKeyDown(1))
            {
                PushScene(new Tutorial(this));
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }
            if (button[2].isSelected && JoyStick.IsOnKeyDown(1))
            {
                PushScene(new Option(this));
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }
        }
Example #17
0
        public PauseMenu(Stage privousScene)
            : base(privousScene)
        {
            sceneTitle     = "Pause";
            drawBackGround = false;

            menuString = new string[] {
                "Resume",
                //"Option",
                "BackToMenu",
                "DebugMenu",
                //"Exit"
            };
            buttonNum = menuString.Length;
            button    = new Button[buttonNum];
            for (int i = 0; i < buttonNum; i++)
            {
                button[i].color = Color.Blue;
                button[i].name  = menuString[i];
            }
            SoundControl.Pause();

            Load();
        }
Example #18
0
        protected override void ButtonUpdate()
        {
            if (JoyStick.IsOnKeyDown(3) || JoyStick.IsOnKeyDown(8))
            {
                isEndScene = true;
                if (!game.isMuted)
                {
                    cancel.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }

            if (KeyInput.IsOnKeyDown(Microsoft.Xna.Framework.Input.Keys.T))
            {
                if (!game.inDebugMode)
                {
                    game.inDebugMode = true;
                }
                else if (game.inDebugMode)
                {
                    game.inDebugMode = false;
                }
            }

            if (button[0].isSelected && JoyStick.IsOnKeyDown(1))                        // Resume
            {
                isEndScene = true;
                (upperScene as Stage).isPausing = false;

                if (!game.isMuted)
                {
                    SoundControl.Resume();
                }
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }

            /*if (button[1].isSelected && JoyStick.IsOnKeyDown(1)) {		// Option
             *      PushScene(new Option(this));
             *      if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f);
             * }*/

            if (button[1].isSelected && JoyStick.IsOnKeyDown(1))                        // to Menu
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
                if (!game.isMuted)
                {
                    SoundControl.Play();
                }
                BackScene(4);
            }

            if (button[2].isSelected && JoyStick.IsOnKeyDown(1))                        // to DebugMenu
            {
                PushScene(new DebugMenu(this, (upperScene as Stage)));
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }

            /*if (button[3].isSelected && JoyStick.IsOnKeyDown(1)) {		// Exit
             *      game.Exit();
             *      if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f);
             * }*/
        }
Example #19
0
        protected override void ButtonUpdate()
        {
            /*if () {
             *  isEndScene = true;
             *  if (!game.isMuted) cancel.Play(SoundControl.volumeAll, 0f, 0f);
             * }*/

            // BGM
            if (button[0].isSelected && JoyStick.onStickDirectionChanged)                       // BGM
            {
                if (JoyStick.stickDirection == Direction.RIGHT)
                {
                    if (musicIndex < musics.Length - 1)
                    {
                        musicIndex++;
                    }
                }
                else if (JoyStick.stickDirection == Direction.LEFT)
                {
                    if (musicIndex > 0)
                    {
                        musicIndex--;
                    }
                }
            }
            if (button[0].isSelected && JoyStick.IsOnKeyDown(1))
            {
                SoundControl.Stop();
                musicInstance.Stop();
                musicInstance        = musics[musicIndex].CreateInstance();
                musicInstance.Volume = musicVolume;
                musicInstance.Play();
            }
            if (button[1].isSelected && JoyStick.onStickDirectionChanged)                       // BGM volume
            {
                if (JoyStick.stickDirection == Direction.RIGHT && musicVolume <= 0.95f)
                {
                    musicVolume += .05f;
                }
                else if (JoyStick.stickDirection == Direction.LEFT && musicVolume >= 0.05f)
                {
                    musicVolume -= .05f;
                }
            }

            // SE
            if (button[2].isSelected && JoyStick.onStickDirectionChanged)                       // SE
            {
                if (JoyStick.stickDirection == Direction.RIGHT)
                {
                    if (seIndex < soundEffects.Length - 1)
                    {
                        seIndex++;
                    }
                }
                else if (JoyStick.stickDirection == Direction.LEFT)
                {
                    if (seIndex > 0)
                    {
                        seIndex--;
                    }
                }
            }
            if (button[2].isSelected && JoyStick.IsOnKeyDown(1))
            {
                SoundControl.Stop();
                seInstance.Stop();
                seInstance        = soundEffects[seIndex].CreateInstance();
                seInstance.Volume = seVolume;
                seInstance.Play();
            }
            if (button[3].isSelected && JoyStick.onStickDirectionChanged)                       // SE volume
            {
                if (JoyStick.stickDirection == Direction.RIGHT && seVolume <= 0.95f)
                {
                    seVolume += .05f;
                }
                else if (JoyStick.stickDirection == Direction.LEFT && seVolume >= 0.05f)
                {
                    seVolume -= .05f;
                }
            }

            if (button[4].isSelected && JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(3) || JoyStick.IsOnKeyDown(2))                                  // Back
            {
                musicInstance.Stop();
                seInstance.Stop();
                SoundControl.Stop();
                if (!game.isMuted)
                {
                    cancel.Play(SoundControl.volumeAll, 0f, 0f);
                }
                isEndScene = true;
                SoundControl.IniMusic("Audio\\BGM\\menu-b", true);
                SoundControl.Play();
            }
        }
Example #20
0
        protected override void ButtonUpdate()
        {
            /*if (button[0].isSelected && JoyStick.IsOnKeyDown(1)) {					// KeyConfig
             *                  game.PushScene(new KeyConfig(this));
             *  if (!game.isMuted) choose.Play(SoundControl.volumeAll, 0f, 0f);
             * }*/
            if (!isEndScene && SoundControl.musicInstance.State == SoundState.Stopped)
            {
                SoundControl.IniMusic("Audio\\BGM\\menu-b", true);
                SoundControl.Play();
            }

            if (button[0].isSelected && JoyStick.IsOnKeyDown(1))                                                        // FullScreen / Window
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                game.graphics.ToggleFullScreen();
            }
            if (button[1].isSelected && JoyStick.onStickDirectionChanged)                                   // Volume Control
            {
                if (JoyStick.stickDirection == Direction.RIGHT && SoundControl.volumeAll <= .95f)
                {
                    game.wholeVolume = SoundControl.volumeAll += .05f;
                    SoundControl.musicInstance.Volume += .05f;
                }
                else if (JoyStick.stickDirection == Direction.LEFT && SoundControl.volumeAll >= 0.05f)
                {
                    game.wholeVolume = SoundControl.volumeAll -= .05f;
                    SoundControl.musicInstance.Volume -= .05f;
                }
            }
            if (button[2].isSelected && JoyStick.IsOnKeyDown(1))                                                        // Mute
            {
                if (game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);                                                // ここだけはわかりやすさのため他のSEの条件の逆にする
                }
                if (!game.isMuted)
                {
                    game.isMuted = true;
                    SoundControl.Stop();
                }
                else
                {
                    game.isMuted = false;
                    SoundControl.Play();
                }
            }
            if (button[3].isSelected && JoyStick.IsOnKeyDown(1))                                                        // Sound Test
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                PushScene(new SoundTest(this));
            }


            if (button[4].isSelected && JoyStick.IsOnKeyDown(1))                                                        // Ranking
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                PushScene(new Ranking(this));
            }
            if (button[5].isSelected && JoyStick.IsOnKeyDown(1))                                                // StageSelect
            {
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                PushScene(new StageSelect(this));
            }
            if (button[6].isSelected && JoyStick.IsOnKeyDown(1))                                                // Credit
            {
                SoundControl.Stop();
                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
                PushScene(new Ending(this, false));
            }
            if (button[7].isSelected && JoyStick.IsOnKeyDown(1))
            {
                if (!game.twoButtonMode)
                {
                    game.twoButtonMode = true;
                }
                else
                {
                    game.twoButtonMode = false;
                }

                if (!game.isMuted)
                {
                    choose.Play(SoundControl.volumeAll, 0f, 0f);
                }
            }
            if (button[8].isSelected && JoyStick.IsOnKeyDown(1) || JoyStick.IsOnKeyDown(3))  // Back To Menu
            {
                if (!game.isMuted)
                {
                    cancel.Play(SoundControl.volumeAll, 0f, 0f);
                }
                isEndScene = true;
                SoundControl.Stop();
                if (upperScene is MainMenu)
                {
                    SoundControl.IniMusic("Audio\\BGM\\menu_new", true);
                    SoundControl.Play();
                }
            }
        }