/zoeplat

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

« back to all changes in this revision

Viewing changes to main.lua

  • Committer: Josh C
  • Date: 2013-03-20 01:30:46 UTC
  • Revision ID: josh@9ix.org-20130320013046-da2g35k1jzxdihlz
fps indicator, maybe a new tile

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
                  if minVel[dir] and vel[dir] < minVel[dir] then vel[dir] = minVel[dir] end
78
78
                  if maxVel[dir] and vel[dir] > maxVel[dir] then vel[dir] = maxVel[dir] end
79
79
 
 
80
                  -- ugly hack for falling through floor on really slow frames
 
81
                  if math.abs(vel[dir] * elapsed) > 32 then
 
82
                     print('skip')
 
83
                     return
 
84
                  end
 
85
 
80
86
                  if vel[dir] ~= 0 then self[dir] = self[dir] + vel[dir] * elapsed end
81
87
 
82
88
                  if self[dir] < 0 then self[dir] = 0 end
226
232
   other[dir] = other[dir] + chg
227
233
end
228
234
 
 
235
-- don't use zoetrope physics
 
236
function Sprite:update (elapsed)
 
237
   if self.onUpdate then self:onUpdate(elapsed) end
 
238
end
 
239
 
229
240
GameView = View:extend {
230
241
   onNew = function (self)
231
242
              self:loadLayers('data/map.lua')
233
244
              self:clampTo(self.map)
234
245
           end,
235
246
   onUpdate = function (self)
 
247
                 --print('drawTook: ', the.drawTook)
236
248
                 --print('tick')
237
249
                 --the.player:collide(self.map)
238
250
                 --self.map:collide(the.player)
239
 
              end
 
251
              end,
 
252
   draw = function (self, x, y)
 
253
             View.draw(self, x, y)
 
254
 
 
255
             love.graphics.print('FPS:' .. love.timer.getFPS(), 20, 20)
 
256
          end
240
257
}
241
258
 
242
259
the.app = App:new {