/traderous

To get this branch, use:
bzr branch http://9ix.org/bzr/traderous

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-05-20 16:51:19 UTC
  • Revision ID: josh@9ix.org-20130520165119-mkjh7d9408e6ig0u
extract updating score.  update score again when you calc high score - 
should mitigate a bug I saw happen when thor played that put final score 
+ high score out of sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
                        font = 25,
81
81
                        text = "Game Over" }
82
82
                     the.app.view:add(over)
 
83
 
 
84
                     the.app.view:updateScore()
 
85
 
 
86
                     local score = love.timer.getTime() - the.app.view.gameStart
 
87
                     if score > the.storage.data.highScore then
 
88
                        the.storage.data.highScore = score
 
89
                        the.storage:save()
 
90
 
 
91
                        the.highScore.text = string.format(
 
92
                           'High Score: %d:%02d', score / 60, score % 60
 
93
                        )
 
94
                     end
83
95
                  end
84
96
               end
85
97
}
 
 
b'\\ No newline at end of file'