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
49adb447
Commit
49adb447
authored
Sep 04, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1059 from vlidholt/master
Improvements to demo game
parents
4d84e1b7
ceef6321
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
game_object_factory.dart
examples/game/lib/game_object_factory.dart
+18
-0
game_objects.dart
examples/game/lib/game_objects.dart
+4
-2
No files found.
examples/game/lib/game_object_factory.dart
View file @
49adb447
...
...
@@ -46,11 +46,29 @@ class GameObjectFactory {
}
void
addBossFight
(
int
l
,
double
yPos
)
{
// Add boss
EnemyBoss
boss
=
new
EnemyBoss
(
this
);
Point
pos
=
new
Point
(
0.0
,
yPos
+
_chunkSpacing
/
2.0
);
addGameObject
(
boss
,
pos
);
playerState
.
boss
=
boss
;
// Add boss's helpers
if
(
l
>=
1
)
{
EnemyDestroyer
destroyer0
=
new
EnemyDestroyer
(
this
);
addGameObject
(
destroyer0
,
new
Point
(-
80.0
,
yPos
+
_chunkSpacing
/
2.0
+
70.0
));
EnemyDestroyer
destroyer1
=
new
EnemyDestroyer
(
this
);
addGameObject
(
destroyer1
,
new
Point
(
80.0
,
yPos
+
_chunkSpacing
/
2.0
+
70.0
));
if
(
l
>=
2
)
{
EnemyDestroyer
destroyer0
=
new
EnemyDestroyer
(
this
);
addGameObject
(
destroyer0
,
new
Point
(-
80.0
,
yPos
+
_chunkSpacing
/
2.0
-
70.0
));
EnemyDestroyer
destroyer1
=
new
EnemyDestroyer
(
this
);
addGameObject
(
destroyer1
,
new
Point
(
80.0
,
yPos
+
_chunkSpacing
/
2.0
-
70.0
));
}
}
}
}
examples/game/lib/game_objects.dart
View file @
49adb447
...
...
@@ -167,13 +167,15 @@ class Laser extends GameObject {
Laser
(
GameObjectFactory
f
,
int
level
,
double
r
)
:
super
(
f
)
{
// Game object properties
radius
=
10.0
;
removeLimit
=
640.0
;
removeLimit
=
_gameSizeHeight
+
radius
;
canDamageShip
=
false
;
canBeDamaged
=
false
;
impact
=
1.0
+
level
*
0.5
;
// Offset for movement
_offset
=
new
Offset
(
math
.
cos
(
radians
(
r
))
*
10.0
,
math
.
sin
(
radians
(
r
))
*
10.0
);
_offset
=
new
Offset
(
math
.
cos
(
radians
(
r
))
*
8.0
,
math
.
sin
(
radians
(
r
))
*
8.0
-
f
.
playerState
.
scrollSpeed
);
// Drawing properties
rotation
=
r
+
90.0
;
...
...
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