/traderous

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

« back to all changes in this revision

Viewing changes to main.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:
120
120
 
121
121
              the.score = Text:new{
122
122
                 width = the.app.width,
123
 
                 --align = 'center',
 
123
                 align = 'center',
124
124
                 font = 25}
125
125
              self:add(the.score)
126
126
 
191
191
                end,
192
192
   draw = function (self, x, y)
193
193
             View.draw(self, x, y)
194
 
             --love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
 
194
             love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
195
195
          end,
196
196
   updateScore = function(self)
197
197
                    local t = love.timer.getTime() - self.gameStart
200
200
 
201
201
                    the.score.text = string.format('Score: %d:%02d', m, s)
202
202
                    the.score.y = the.player.y - the.app.height / 2 + the.player.height
203
 
                    the.score.x = the.player.x - the.app.width / 2 + the.player.width
 
203
                    the.score.x = the.player.x - the.app.width / 2
204
204
 
205
205
                    the.highScore.y = the.player.y - the.app.height / 2 + the.player.height
206
206
                    the.highScore.x = the.player.x - the.app.width / 2