/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 06:03:56 UTC
  • Revision ID: josh@9ix.org-20130309060356-qvi2yd0odhfr3e6t
try to track X collisions.  break out Sprite's physics in prep for 
overriding them completely.

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
66
74
                  elseif xOverlap > yOverlap then
67
75
                     -- check if we've moved since collisions were generated
68
76
                     local xov, yov = self:overlap(other.x, other.y,
102
110
              self.view = GameView:new()
103
111
              --print(inspect(_(the.app):keys()))
104
112
              self.console:watch('onGround', 'the.player.onGround')
 
113
              self.console:watch('onWall', 'the.player.onWall')
105
114
           end,
106
115
   onUpdate = function (self, dt)
107
116
                 if the.keys:justPressed('escape') and