Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a17662e6
Commit
a17662e6
authored
Jul 29, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds delay between game over and return to main screen in demo game
parent
7be4e421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
game_demo_world.dart
packages/flutter/example/game/lib/game_demo_world.dart
+7
-2
No files found.
packages/flutter/example/game/lib/game_demo_world.dart
View file @
a17662e6
...
...
@@ -46,6 +46,7 @@ class GameDemoWorld extends NodeWithSize {
// Game state
int
_numFrames
=
0
;
bool
_isGameOver
=
false
;
int
_gameOverFrame
;
int
_currentLevel
=
0
;
// Heads up display
...
...
@@ -320,6 +321,11 @@ class GameDemoWorld extends NodeWithSize {
if
(
_numFrames
>
_numFramesShieldActive
)
_shield
.
visible
=
false
;
else
if
(
_numFrames
>
_numFramesShieldActive
-
_numFramesShieldFlickers
)
_shield
.
visible
=
!
_shield
.
visible
;
// Check for exit back to main screen
if
(
_isGameOver
&&
_numFrames
-
_gameOverFrame
==
60
)
{
_navigator
.
pop
();
}
_numFrames
++;
}
...
...
@@ -350,6 +356,7 @@ class GameDemoWorld extends NodeWithSize {
// Set game over
_isGameOver
=
true
;
_gameOverFrame
=
_numFrames
;
_gameOverCallback
(
_hud
.
score
);
// Remove the ship
...
...
@@ -357,8 +364,6 @@ class GameDemoWorld extends NodeWithSize {
// Add an explosion
addExplosion
(
AsteroidSize
.
large
,
_ship
.
position
);
_navigator
.
pop
();
}
// Handling controls
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment