diff --git a/src/sj/PlayScene.d b/src/sj/PlayScene.d index e24c7af..c2c5e06 100644 --- a/src/sj/PlayScene.d +++ b/src/sj/PlayScene.d @@ -42,15 +42,16 @@ class PlayScene : SceneInterface { music_.PlayForGame(); } override SceneInterface Update(KeyInput input) { - const beat = music_.beat; + beat_ = music_.beat; - if (beat >= context_.length) { + if (beat_ >= context_.length) { music_.StopPlaying(); + result_scene_.Initialize(music_, score_); return result_scene_; } - context_.OperateScheduledControllers(beat); + context_.OperateScheduledControllers(beat_); context_.actor.Accelarate(GetAccelarationFromKeyInput(input)); @@ -78,6 +79,10 @@ class PlayScene : SceneInterface { context_.DrawActor(); context_.EndDrawing(); + + if (beat_ >= context_.length) { + context_.destroy(); + } } private: @@ -95,5 +100,6 @@ class PlayScene : SceneInterface { Music music_; sjplayer.Context context_; - int score_; + float beat_; + int score_; } diff --git a/src/sj/TitleScene.d b/src/sj/TitleScene.d index 0cff0ff..2b40f70 100644 --- a/src/sj/TitleScene.d +++ b/src/sj/TitleScene.d @@ -65,7 +65,7 @@ class TitleScene : SceneInterface { lobby_.cube_interval = cube_interval_ease_.Calculate(ratio); - if (input.down) { + if (anime_.isFinished && input.down) { select_scene_.Initialize(); return select_scene_; }