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
75e0123b
Commit
75e0123b
authored
3 years ago
by
Paolo.Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
refactor: #fe fith scene spawning
parent
102e2111
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/js/fight_scene.ts
+12
-16
12 additions, 16 deletions
frontend/src/js/fight_scene.ts
with
12 additions
and
16 deletions
frontend/src/js/fight_scene.ts
+
12
−
16
View file @
75e0123b
...
...
@@ -126,7 +126,7 @@ export default class FightScene extends Phaser.Scene {
})
).
data
;
gameStart
(
this
);
spawnFoes
(
);
}
createAnimations
()
{
...
...
@@ -333,21 +333,17 @@ export default class FightScene extends Phaser.Scene {
this
.
hud
.
input
.
text
=
inputStatus
.
final
;
};
}
}
function
gameStart
(
scene
:
any
)
{
spawn
(
scene
);
}
async
function
spawn
(
scene
:
any
)
{
if
(
!
scene
.
scene
.
isActive
())
return
;
await
spawnFoe
(
scene
);
scene
.
time
.
now
;
const
delay
=
(
8
*
1000
*
(
60
*
1000
-
s
c
ene
.
time
.
now
))
/
60
/
1000
+
2
*
1000
;
setTimeout
(
()
=>
spawn
(
scene
),
Math
.
max
(
2000
,
delay
));
}
async
spawnFoes
(
)
{
if
(
!
this
.
scene
.
isActive
())
return
;
await
this
.
spawnFoe
();
const
delay
=
(
8
*
1000
*
(
60
*
1000
-
this
.
time
.
now
))
/
60
/
1000
+
2
*
1000
;
// TODO: think of a progression which makes
sen
s
e
setTimeout
(
this
.
spawnFoes
.
bind
(
this
),
Math
.
max
(
2000
,
delay
));
}
async
function
spawnFoe
(
scene
:
FightScene
)
{
await
new
Foe
(
scene
).
initialize
();
async
spawnFoe
()
{
await
new
Foe
(
this
).
initialize
();
}
}
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