/traderous

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-06-19 01:06:14 UTC
  • Revision ID: josh@9ix.org-20130619010614-j3rbcv1c0my2tw0f
enemy shields and death

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                           b = Bullet:new{
62
62
                              x = self.x + self.width / 2,
63
63
                              y = self.y + self.height / 2,
64
 
                              rotation = self.rotation
 
64
                              rotation = self.rotation,
 
65
                              source = self
65
66
                           }
66
67
                           self.lastFired = love.timer.getTime()
67
68
                     end
75
76
                   self:collide(the.rockColliders)
76
77
                end,
77
78
   onCollide = function(self, other)
78
 
                  if other:instanceOf(Bullet) then
 
79
                  if other:instanceOf(Bullet) and other.source ~= self then
79
80
                     if self.shield.strength == 0 then
80
81
                        -- die
81
82
                        the.app.view:add( Boom:new {
88
89
                        self.thrust:die()
89
90
                     else
90
91
                        self.shield:onHit()
91
 
                        other:die()
92
 
                        the.bullets:remove(other)
93
92
                     end
 
93
 
 
94
                     other:die()
 
95
                     the.bullets:remove(other)
94
96
                  end
95
97
 
96
98
                  if other:instanceOf(RockCollider) then