/ld27

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2014-07-04 22:05:15 UTC
  • Revision ID: josh@9ix.org-20140704220515-1lyoulmix915mlcp
propagate scaling / translate properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
STRICT = false
 
1
STRICT = true
2
2
DEBUG = false
 
3
LOVEBIRD = false
3
4
 
4
5
if SDL then
5
6
  print = SDL.log
6
7
end
7
8
 
8
 
--lovebird = require 'lovebird'
9
9
require 'zoetrope'
10
10
--require 'pepperprof'
11
11
--inspect = require 'inspect'
181
181
 
182
182
           end,
183
183
   onUpdate = function(self, elapsed)
184
 
     if the.keys:allJustPressed() or the.mouse:pressed() then
185
 
       the.app.view = GameView:new()
186
 
     end
187
 
   end
 
184
                 if the.keys:allJustPressed() then
 
185
                    the.app.view = GameView:new()
 
186
                 end
 
187
              end
188
188
}
189
189
 
190
190
the.app = App:new {
213
213
                 end
214
214
              end,
215
215
   update = function(self, dt)
216
 
     if lovebird then
217
 
       fps = love.timer.getFPS()
218
 
       lovebird.update()
 
216
     if LOVEBIRD then
 
217
       require('lovebird').update()
219
218
     end
220
219
     App.update(self, dt)
221
220
   end,
237
236
         self.scale = 1.5
238
237
       elseif winh < the.app.height then
239
238
         self.scale = winh / the.app.height
240
 
       else
241
 
         self.scale = 1
242
239
       end
243
240
       view.realTranslate.x = math.floor((winw - self.width * self.scale) / 2)
244
241
       view.realTranslate.y = math.floor((winh - self.height * self.scale) / 2)