/zoeplat

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-04-10 23:47:59 UTC
  • Revision ID: josh@9ix.org-20130410234759-nrzne3xed1puy1v2
put sprite and player in their own files

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
   collisions = {},
13
13
   onWall = false,
14
14
   leftWallAt = 0,
15
 
   jump = love.audio.newSource('data/jump.ogg', 'static'),
16
15
   onNew = function (self)
17
16
              self.velocity.y = 0
18
17
              self.maxVelocity.y = 400
73
72
                     end
74
73
 
75
74
                     if the.keys:justPressed('up') and
76
 
                      (self.onGround or
77
 
                       (DEBUG and the.console.visible) or
 
75
                      (self.onGround or the.console.visible or
78
76
                       (love.timer.getTime() - self.leftWallAt < .1) ) then
79
77
                        self.velocity.y = -400
80
78
                        self.jumping = true
81
 
                        --love.audio.play(self.jump)
82
79
                     end
83
80
                  end,
84
81
   update = function (self, elapsed)