Пример #1
0
 public SceneTitle(IAudioEngine s, ShanghaiEXE p, SaveData save)
     : base(s, p, save)
 {
     this.parent    = p;
     this.nowscene  = SceneTitle.TITLESCENE.init;
     this.test      = false;
     this.printLoad = p.loadSUCCESS;
 }
Пример #2
0
 private void KeyControl()
 {
     if (Input.IsPress(Button._A) || Input.IsPress(Button._Start))
     {
         this.nowscene = SceneTitle.TITLESCENE.fade;
         this.sound.PlaySE(SoundEffect.thiptransmission);
     }
     if (Input.IsPress(Button._B))
     {
         this.nowscene = SceneTitle.TITLESCENE.pushbutton;
         this.sound.PlaySE(SoundEffect.cancel);
     }
     if (this.keywait <= 0)
     {
         if (!this.printLoad)
         {
             return;
         }
         if (Input.IsPush(Button.Up))
         {
             --this.Menu;
             this.keywait = Input.IsPress(Button.Up) ? 25 : 5;
             this.sound.PlaySE(SoundEffect.movecursol);
         }
         if (Input.IsPush(Button.Down))
         {
             ++this.Menu;
             this.keywait = Input.IsPress(Button.Down) ? 25 : 5;
             this.sound.PlaySE(SoundEffect.movecursol);
         }
     }
     else
     {
         this.keywait = Input.IsUp(Button.Up) || Input.IsUp(Button.Down) ? 0 : this.keywait - 1;
     }
 }
Пример #3
0
        public override void Updata()
        {
            switch (this.nowscene)
            {
            case SceneTitle.TITLESCENE.init:
                if (this.fadealpha <= 0)
                {
                    if (this.savedata.loadEnd)
                    {
                        this.printLoad = this.savedata.loadSucces;
                        if (this.printLoad)
                        {
                            this.menu = SceneTitle.TITLEMENU.Load;
                        }
                        this.nowscene = SceneTitle.TITLESCENE.pushbutton;
                        this.sound.StartBGM(this.titlemusic);
                        this.printpush = true;
                        break;
                    }
                    break;
                }
                this.fadealpha -= 8;
                if (this.fadealpha <= 0)
                {
                    this.fadealpha = 0;
                }
                break;

            case SceneTitle.TITLESCENE.pushbutton:
                if (Input.IsPush(Button.Esc))
                {
                    this.parent.Close();
                }
                if (backpx % 64 == 0)
                {
                    this.printpush = this.savedata.loadEnd && !this.printpush;
                }
                if (Input.IsPress(Button._Start) && this.savedata.loadEnd)
                {
                    this.StarCheck();
                    this.sound.PlaySE(SoundEffect.decide);
                    this.nowscene = SceneTitle.TITLESCENE.select;
                    this.frame    = 0;
                    this.ShakeEnd();
                    break;
                }
                break;

            case SceneTitle.TITLESCENE.select:
                if (Input.IsPush(Button.Esc))
                {
                    this.parent.Close();
                }
                if (backpx % 8 == 0)
                {
                    ++this.frame;
                    if (this.frame > 12)
                    {
                        ++this.starAnime;
                    }
                    if (this.starAnime >= 4)
                    {
                        this.starAnime = 0;
                        this.frame     = 0;
                    }
                }
                this.KeyControl();
                this.Command();
                break;

            case SceneTitle.TITLESCENE.fade:
                this.fadealpha += 8;
                if (this.fadealpha >= byte.MaxValue)
                {
                    this.fadealpha        = byte.MaxValue;
                    this.parent.battlenum = 0;
                    switch (this.menu)
                    {
                    case SceneTitle.TITLEMENU.Start:
                        bool flag = false;
                        if (this.savedata.loadEnd)
                        {
                            flag = this.savedata.FlagList[14];
                        }
                        this.savedata.Init();
                        if (flag)
                        {
                            this.savedata.FlagList[99] = true;
                        }
                        this.parent.tutorial = false;
                        this.parent.ChangeOfSecne(Scene.Main);
                        this.parent.NewGame(this.plus);
                        break;

                    case SceneTitle.TITLEMENU.Load:
                        if (this.savedata.loadEnd)
                        {
                            this.parent.ChangeOfSecne(Scene.Main);
                            this.parent.LoadGame();
                            break;
                        }
                        break;
                    }
                    this.sound.StopBGM();
                    break;
                }
                break;
            }
            this.backpx += 3;
            if (this.backpx < 240)
            {
                return;
            }
            this.backpx = 0;
        }