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
37d0c1a8
Commit
37d0c1a8
authored
Sep 01, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds small explosions to demo game
parent
6de024f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
explosions.dart
examples/game/lib/explosions.dart
+24
-0
game_objects.dart
examples/game/lib/game_objects.dart
+4
-0
No files found.
examples/game/lib/explosions.dart
View file @
37d0c1a8
...
...
@@ -81,5 +81,29 @@ class ExplosionBig extends Explosion {
}
class
ExplosionMini
extends
Explosion
{
ExplosionMini
(
SpriteSheet
sheet
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
Sprite
star
=
new
Sprite
(
sheet
[
"star_0.png"
]);
star
.
scale
=
0.5
;
star
.
colorOverlay
=
new
Color
(
0xff95f4fb
);
star
.
transferMode
=
sky
.
TransferMode
.
plus
;
addChild
(
star
);
double
rotationStart
=
randomDouble
()
*
90.0
;
double
rotationEnd
=
180.0
+
randomDouble
()
*
90.0
;
if
(
i
==
0
)
{
rotationStart
=
-
rotationStart
;
rotationEnd
=
-
rotationEnd
;
}
ActionTween
rotate
=
new
ActionTween
((
a
)
=>
star
.
rotation
=
a
,
rotationStart
,
rotationEnd
,
0.2
);
actions
.
run
(
rotate
);
ActionTween
fade
=
new
ActionTween
((
a
)
=>
star
.
opacity
=
a
,
1.0
,
0.0
,
0.2
);
actions
.
run
(
fade
);
}
ActionSequence
seq
=
new
ActionSequence
([
new
ActionDelay
(
0.2
),
new
ActionRemoveNode
(
this
)]);
actions
.
run
(
seq
);
}
}
examples/game/lib/game_objects.dart
View file @
37d0c1a8
...
...
@@ -165,6 +165,10 @@ class Laser extends GameObject {
void
move
()
{
position
+=
_offset
;
}
Explosion
createExplosion
()
{
return
new
ExplosionMini
(
f
.
sheet
);
}
}
Color
colorForDamage
(
double
damage
,
double
maxDamage
)
{
...
...
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