Added a simple particle effect to visualize how the player's soul
shatters upon death. The Game Over screen had to be delayed as the
player needs some time to see the particle effect.
modified: ld40.js
new file: soulbreak.png
new file: soulbreak.svg
const WAIT_MONSTERSHOOT = 500;
const WAIT_MONSTERSPAWN = 20000;
const WAIT_DETERMINATION = 4000;
const WAIT_MONSTERSHOOT = 500;
const WAIT_MONSTERSPAWN = 20000;
const WAIT_DETERMINATION = 4000;
+ const WAIT_DEATH = 4000;
const WALL_THICKNESS = 16;
const WALL_BORDER = 8;
const WALL_BORDERBOTTOM = 48;
const WALL_THICKNESS = 16;
const WALL_BORDER = 8;
const WALL_BORDERBOTTOM = 48;
this.lasttime_shoot = 0;
this.lasttime_mode = 0;
this.lasttime_damage = 0;
this.lasttime_shoot = 0;
this.lasttime_mode = 0;
this.lasttime_damage = 0;
+ this.lasttime_death = 0;
this.speed = SPEED_PLAYER;
this.switchmode(MODE_DETERMINATION);
this.weapon = new JusticeBlaster(game, this);
this.weapon.bulletSpeed = SPEED_PPROJECTILE;
this.healthBar = new HealthBar(60, game.world.height - (WALL_BORDERBOTTOM / 2));
this.speed = SPEED_PLAYER;
this.switchmode(MODE_DETERMINATION);
this.weapon = new JusticeBlaster(game, this);
this.weapon.bulletSpeed = SPEED_PPROJECTILE;
this.healthBar = new HealthBar(60, game.world.height - (WALL_BORDERBOTTOM / 2));
+ this.soulbreakEmitter = this.game.add.emitter(0, 0, 8);
+ this.soulbreakEmitter.gravity = 1000;
+ this.soulbreakEmitter.setXSpeed(-300, 300);
+ this.soulbreakEmitter.makeParticles('soulbreak');
this.health = 0;
this.healthBar.update(this.love, this.maxHealth, this.health);
super.kill();
this.health = 0;
this.healthBar.update(this.love, this.maxHealth, this.health);
super.kill();
- this.game.state.start('GameOver');
+ this.soulbreakEmitter.x = this.x;
+ this.soulbreakEmitter.y = this.y;
+ this.soulbreakEmitter.explode(2000, 8);
+ this.lasttime_death = this.game.time.now;
game.load.image('monster', 'monster.png');
game.load.image('determination', 'determination.png');
game.load.image('projectile', 'projectile.png');
game.load.image('monster', 'monster.png');
game.load.image('determination', 'determination.png');
game.load.image('projectile', 'projectile.png');
+ game.load.image('soulbreak', 'soulbreak.png');
if ((game.time.now - player.lastmovetime) > WAIT_KEY) player.body.velocity.x = player.body.velocity.y = 0;
if ((game.time.now - player.lastmovetime) > WAIT_KEY) player.body.velocity.x = player.body.velocity.y = 0;
+ if ((!player.alive) && (game.time.now > (player.lasttime_death + WAIT_DEATH)))
+ {
+ game.state.start('GameOver');
+ }
+
--- /dev/null
+<svg height="10" width="10">
+ <circle cx="5" cy="5" r="2.5" stroke="black" stroke-width="0" fill="red" />
+</svg>