/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)