Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
oetzit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
commul
oetzit
Commits
63ba9df6
Commit
63ba9df6
authored
2 years ago
by
Paolo Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
fix: game over cleanup procedure
parent
acd5ef1c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
frontend/src/js/fight_scene.ts
+0
-7
0 additions, 7 deletions
frontend/src/js/fight_scene.ts
frontend/src/js/main_scene.ts
+8
-0
8 additions, 0 deletions
frontend/src/js/main_scene.ts
with
9 additions
and
7 deletions
CHANGELOG.md
+
1
−
0
View file @
63ba9df6
...
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
Delegate word API requests to scene in order to avoid scrambled events after game over.
-
Delegate word API requests to scene in order to avoid scrambled events after game over.
-
Spawner scene activity gates.
-
Spawner scene activity gates.
-
Game over cleanup procedure.
## [1.10.5] - 2022-09-28
## [1.10.5] - 2022-09-28
...
...
This diff is collapsed.
Click to expand it.
frontend/src/js/fight_scene.ts
+
0
−
7
View file @
63ba9df6
...
@@ -49,19 +49,12 @@ export default class FightScene extends MainScene {
...
@@ -49,19 +49,12 @@ export default class FightScene extends MainScene {
})
})
).
data
;
).
data
;
this
.
spawner
.
remove
();
this
.
music
.
stop
();
this
.
music
.
destroy
();
this
.
game
.
records
.
updateLast
({
this
.
game
.
records
.
updateLast
({
level
:
this
.
getDifficulty
(
this
.
beGame
.
ended_at_gmtm
??
0
),
level
:
this
.
getDifficulty
(
this
.
beGame
.
ended_at_gmtm
??
0
),
words
:
this
.
acceptedWords
,
words
:
this
.
acceptedWords
,
score
:
this
.
beGame
.
score
??
0
,
score
:
this
.
beGame
.
score
??
0
,
timer
:
this
.
beGame
.
ended_at_gmtm
??
0
,
timer
:
this
.
beGame
.
ended_at_gmtm
??
0
,
});
});
this
.
scene
.
start
(
"
game_over
"
);
}
}
//=[ Ambient transitions ]====================================================
//=[ Ambient transitions ]====================================================
...
...
This diff is collapsed.
Click to expand it.
frontend/src/js/main_scene.ts
+
8
−
0
View file @
63ba9df6
...
@@ -83,6 +83,12 @@ export default class MainScene extends Phaser.Scene {
...
@@ -83,6 +83,12 @@ export default class MainScene extends Phaser.Scene {
async
endGame
()
{
async
endGame
()
{
this
.
tweens
.
killAll
();
this
.
tweens
.
killAll
();
this
.
time
.
removeAllEvents
();
this
.
time
.
removeAllEvents
();
// TODO: this sucks, but it will be a FightScene
(
this
as
any
).
spawner
.
remove
();
this
.
music
.
stop
();
this
.
music
.
destroy
();
// TODO: are we being thorough? will the next frame always arrive in time to guarantee cleanup?
// TODO: are we being thorough? will the next frame always arrive in time to guarantee cleanup?
this
.
setGameTimePaused
(
true
);
this
.
setGameTimePaused
(
true
);
this
.
foes
.
forEach
((
foe
)
=>
foe
.
destroy
());
this
.
foes
.
forEach
((
foe
)
=>
foe
.
destroy
());
...
@@ -91,6 +97,8 @@ export default class MainScene extends Phaser.Scene {
...
@@ -91,6 +97,8 @@ export default class MainScene extends Phaser.Scene {
this
.
typewriter
.
resetInputStatus
();
this
.
typewriter
.
resetInputStatus
();
await
this
.
afterGameEnd
();
await
this
.
afterGameEnd
();
this
.
scene
.
start
(
"
game_over
"
);
}
}
async
afterGameEnd
()
{
async
afterGameEnd
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment