diff --git a/examples/game/lib/game_object_factory.dart b/examples/game/lib/game_object_factory.dart index 807ae9067f..afe0178eff 100644 --- a/examples/game/lib/game_object_factory.dart +++ b/examples/game/lib/game_object_factory.dart @@ -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)); + } + } } } diff --git a/examples/game/lib/game_objects.dart b/examples/game/lib/game_objects.dart index dd136be184..f05fa2d6c4 100644 --- a/examples/game/lib/game_objects.dart +++ b/examples/game/lib/game_objects.dart @@ -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;