/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-09 05:49:40 UTC
  • Revision ID: josh@9ix.org-20130309054940-hg1a3ro2j8yj32p7
more reliable onGround calc

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                  -- assumption: any other collision is with a solid map tile
64
64
                  if yOverlap > xOverlap then
65
65
                     other:displace(self)
66
 
 
67
 
                     if self.velocity.x > 0 then
68
 
                        self.onWall = 'right'
69
 
                     elseif self.velocity.x < 0 then
70
 
                        self.onWall = 'left'
71
 
                     else
72
 
                        print '??'
73
 
                     end
74
66
                  elseif xOverlap > yOverlap then
75
67
                     -- check if we've moved since collisions were generated
76
68
                     local xov, yov = self:overlap(other.x, other.y,
110
102
              self.view = GameView:new()
111
103
              --print(inspect(_(the.app):keys()))
112
104
              self.console:watch('onGround', 'the.player.onGround')
113
 
              self.console:watch('onWall', 'the.player.onWall')
114
105
           end,
115
106
   onUpdate = function (self, dt)
116
107
                 if the.keys:justPressed('escape') and