/spacey

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-05-09 00:35:25 UTC
  • Revision ID: josh@9ix.org-20130509003525-ad51iyqb2j9eg1wl
get lasers going the right way

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
}
21
21
 
22
22
local velLimit = 600
 
23
--local velLimit = 50
23
24
SpacePlayer = Tile:extend{
24
25
   image = 'data/ship.png',
25
26
   maxVelocity = {x=velLimit,y=velLimit},
37
38
 
38
39
                     --TODO: acceleration limit.  It should at least be proportional (not 16:9)
39
40
 
40
 
                     if the.mouse:pressed() then -- assumes left button
41
 
                        if love.timer.getTime() - self.lastFired > 0.25 then
 
41
                     if the.mouse:pressed() and -- assumes left button
 
42
                       love.timer.getTime() - self.lastFired > 0.25 and
 
43
                       the.cursor:inTargetArea() then
42
44
                           --print('pew')
43
45
                           b = Bullet:new{
44
46
                              x = self.x, y = self.y,
45
 
                              rotation = self.rotation,
46
47
                           }
47
48
                           the.app.view:add(b)
48
49
                           self.lastFired = love.timer.getTime()
49
 
                        end
50
50
                     end
51
51
                  end,
52
52
   onUpdate = function(self)