/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 04:59:50 UTC
  • Revision ID: josh@9ix.org-20130309045950-ufjp2txry3c0cc05
only jump when you're on the ground

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
                     if self.falling then self.jumping = false end
28
28
                     --print(self.jumping, self.falling)
29
29
 
30
 
                     if not self:onGround() then
31
 
                        self:play('jump')
32
 
                     end
33
 
 
34
30
                     self.velocity.x = 0
35
31
                     self.acceleration.y = 800
36
32
 
47
43
                     if the.keys:justPressed('up') and self:onGround() then
48
44
                        self.velocity.y = -400
49
45
                        self.jumping = true
 
46
                        self:play('jump')
50
47
                     end
51
48
                  end,
52
49
   onEndFrame = function (self)
100
97
              --print(inspect(_(the.app):keys()))
101
98
           end,
102
99
   onUpdate = function (self, dt)
103
 
                 if the.keys:justPressed('escape') and 
104
 
                   not self.console.visible then
 
100
                 -- TODO: make this not work if debug console is active
 
101
                 if the.keys:justPressed('escape') then
105
102
                    love.event.quit()
106
103
                 end
107
104
              end