public GameOver(IAudioEngine s, ShanghaiEXE p, SaveData save) : base(s, p, save) { this.parent = p; this.nowscene = GameOver.TITLESCENE.init; this.savedata.Init(); var loadThread = new Thread(new ThreadStart(() => this.savedata.Load(this.parent))); loadThread.Start(); this.sound.StartBGM(this.titlemusic); }
public override void Updata() { switch (this.nowscene) { case GameOver.TITLESCENE.init: if (this.fadealpha <= 0) { this.nowscene = GameOver.TITLESCENE.pushbutton; break; } this.fadealpha -= 8; if (this.fadealpha <= 0) { this.fadealpha = 0; } break; case GameOver.TITLESCENE.pushbutton: ++this.frame; if (this.frame >= 240 && this.savedata.loadEnd) { this.nowscene = GameOver.TITLESCENE.fade; break; } break; case GameOver.TITLESCENE.fade: this.fadealpha += 8; if (this.fadealpha >= byte.MaxValue) { this.fadealpha = byte.MaxValue; this.parent.battlenum = 0; this.parent.ChangeOfSecne(Scene.Title); break; } break; } this.backpx -= 8; if (this.backpx <= 0) { this.backpx = 240; } if (!Input.IsPush(Button._L) || !Input.IsPush(Button._R) || !Input.IsPush(Button._Select) || !Input.IsPush(Button._Start)) { return; } this.sound.StopBGM(); this.parent.ChangeOfSecne(Scene.Title); this.savedata = new SaveData(); }