/traderous

To get this branch, use:
bzr branch /bzr/traderous

« back to all changes in this revision

Viewing changes to shield.lua

  • Committer: Josh C
  • Date: 2013-06-23 02:05:10 UTC
  • Revision ID: josh@9ix.org-20130623020510-i4t86yocvbjab19o
higher planet floor, recharge shields when you land, stop moving when you land

Show diffs side-by-side

added added

removed removed

7
7
      'data/shield.png'
8
8
   },
9
9
   strength = 5,
 
10
   max = 5,
10
11
   velocity = {rotation = 5},
11
 
   visible = false,
12
12
   setImage = function (self)
13
13
                 if self.strength < 1 or self.strength == 5 then
14
14
                    self.visible = false
20
20
              end,
21
21
   onHit = function (self)
22
22
              self.strength = self.strength - 1
23
 
              self:setImage()
24
23
           end,
25
24
   onUpdate = function (self)
 
25
                 self:setImage()
 
26
 
26
27
                 self.x = self.ship.x - 16
27
28
                 self.y = self.ship.y - 16
28
29