Ejemplo n.º 1
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++;
        }
Ejemplo n.º 2
0
 private void BackToLogo()
 {
     if (hasDisplayed)
     {
         counter      = 0;
         hasDisplayed = false;
         SoundControl.Stop();
     }
 }
Ejemplo n.º 3
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;
            }
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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();
            }
        }
Ejemplo n.º 6
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();
            }
        }
Ejemplo n.º 7
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;
         }
     }
 }
Ejemplo n.º 8
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);
                }
            }
        }
Ejemplo n.º 9
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();
                }
            }
        }
Ejemplo n.º 10
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();
            }
        }