From a8179b263d923803786708e4198b97ed8245a380 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Sun, 27 Mar 2016 01:00:45 -0400 Subject: [PATCH] Improve end screen and restarting a bit --- game.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game.coffee b/game.coffee index ec9de4c..ada15d7 100644 --- a/game.coffee +++ b/game.coffee @@ -635,7 +635,8 @@ class TextEffect return if @animation_time > 26 * @repeat @animation_time += 1 - delta = 20 - @animation + to = 20 + (if @repeat is Infinity then @animation_time else 0) + delta = to - @animation @animation_velocity += delta / 20 @animation += @animation_velocity @@ -682,8 +683,6 @@ class Game @deposited_score = 0 @dropping_score = 0 @maximum_score = 0 - - @effects = [] restart: -> @start() @@ -694,6 +693,8 @@ class Game @level.spawn_player() {player} = @level + @effects = [] + @view = {cx: player.x, cy: player.y, scale: 1} @view_to = {cx: player.x, cy: player.y, scale: 1}