X-Git-Url: http://git.megabrutal.com/?p=ld40.git;a=blobdiff_plain;f=ld40.js;h=53e41f87ce314147e88d5301a5a3b91ea399bfc0;hp=e981a9ef0768c78a6868a9e8c0ffdbae3f066660;hb=3657126690124fe9be25d75600ba29b0fd50db63;hpb=7ce54d871c6931882855c54de3c0c24cc8023140 diff --git a/ld40.js b/ld40.js index e981a9e..53e41f8 100644 --- a/ld40.js +++ b/ld40.js @@ -161,6 +161,11 @@ game.physics.arcade.enable(this); } + damage(amount) { + super.damage(amount); + if (this.alive) { game.add.tween(this).to({ x: this.x + (Math.random() - 0.5) * 10 }, 10, Phaser.Easing.Sinusoidal.InOut, true, 0, 8, true); } + } + kill() { super.kill(); player.loveUp();