Commit 49adb447 authored by Viktor Lidholt's avatar Viktor Lidholt

Merge pull request #1059 from vlidholt/master

Improvements to demo game
parents 4d84e1b7 ceef6321
...@@ -46,11 +46,29 @@ class GameObjectFactory { ...@@ -46,11 +46,29 @@ class GameObjectFactory {
} }
void addBossFight(int l, double yPos) { void addBossFight(int l, double yPos) {
// Add boss
EnemyBoss boss = new EnemyBoss(this); EnemyBoss boss = new EnemyBoss(this);
Point pos = new Point(0.0, yPos + _chunkSpacing / 2.0); Point pos = new Point(0.0, yPos + _chunkSpacing / 2.0);
addGameObject(boss, pos); addGameObject(boss, pos);
playerState.boss = boss; 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 { ...@@ -167,13 +167,15 @@ class Laser extends GameObject {
Laser(GameObjectFactory f, int level, double r) : super(f) { Laser(GameObjectFactory f, int level, double r) : super(f) {
// Game object properties // Game object properties
radius = 10.0; radius = 10.0;
removeLimit = 640.0; removeLimit = _gameSizeHeight + radius;
canDamageShip = false; canDamageShip = false;
canBeDamaged = false; canBeDamaged = false;
impact = 1.0 + level * 0.5; impact = 1.0 + level * 0.5;
// Offset for movement // 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 // Drawing properties
rotation = r + 90.0; rotation = r + 90.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment