提交 9aa71b4d 编写于 作者: V Viktor Lidholt

Merge pull request #1059 from vlidholt/master

Improvements to demo game
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册