mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Merge pull request #1059 from vlidholt/master
Improvements to demo game
This commit is contained in:
commit
49adb447a2
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user