/spacey

To get this branch, use:
bzr branch /bzr/spacey

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-05-16 02:41:58 UTC
  • Revision ID: josh@9ix.org-20130516024158-d5jtkfvd2qw709xo
record high scores

Show diffs side-by-side

added added

removed removed

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