Commit dbda2725 authored by Viktor Lidholt's avatar Viktor Lidholt

Adds coins when a boss explodes in demo game

parent 8c958f97
......@@ -468,7 +468,25 @@ class EnemyBoss extends Obstacle {
void destroy() {
f.playerState.boss = null;
NodeWithSize screen = f.playerState.parent;
screen.addChild(new Flash(screen.size, 1.0));
super.destroy();
// Add coins
for (int i = 0; i < 20; i++) {
Coin coin = new Coin(f);
Point pos = new Point(
randomSignedDouble() * 160,
position.y + randomSignedDouble() * 160.0);
f.addGameObject(coin, pos);
}
}
Explosion createExplosion() {
ExplosionBig explo = new ExplosionBig(f.sheet);
explo.scale = 1.5;
return explo;
}
set damage(double d) {
......
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