[fix] Fixed an issue that sjplayer.Context wasn't destroyed after end of the game.
This commit is contained in:
parent
2345cfb22a
commit
47ede702f6
@ -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_;
|
||||
|
||||
float beat_;
|
||||
int score_;
|
||||
}
|
||||
|
@ -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_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user