Permalink
Browse files

effect alpha of player when hit

  • Loading branch information...
1 parent dd9ad8e commit 75ab1b0bec3fe615b964a7cfb9c904c8a48c45e7 @willmcneilly committed Mar 1, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 scripts/coffee/game.coffee
@@ -116,6 +116,11 @@ module.exports = class Game
playerHit: (player, enemy) ->
enemy.kill()
+ bounce = @game.add.tween(@player)
+ bounce
+ .to({ alpha: 0.4 }, 100, Phaser.Easing.Bounce.None)
+ .to({ alpha: @player.alpha }, 100, Phaser.Easing.Bounce.None)
+ .start()
if (@lives == 1)
@player.kill()
@game.state.start('postGame', false)

0 comments on commit 75ab1b0

Please sign in to comment.