projects
/
ld40.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ce54d8
)
Shake monsters when damaged
author
MegaBrutal
<code+git@megabrutal.com>
Fri, 29 Dec 2017 22:55:00 +0000
(23:55 +0100)
committer
MegaBrutal
<code+git@megabrutal.com>
Fri, 29 Dec 2017 22:55:00 +0000
(23:55 +0100)
Monsters should give some feedback when they are damaged to let the
player know that shooting them has effect.
modified: ld40.js
ld40.js
patch
|
blob
|
history
diff --git
a/ld40.js
b/ld40.js
index e981a9ef0768c78a6868a9e8c0ffdbae3f066660..53e41f87ce314147e88d5301a5a3b91ea399bfc0 100644
(file)
--- 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();