/traderous

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

« back to all changes in this revision

Viewing changes to shield.lua

  • Committer: Josh C
  • Date: 2013-06-19 01:12:39 UTC
  • Revision ID: josh@9ix.org-20130619011239-l1h3rnhphkpg0vdk
bring back game over screen

Show diffs side-by-side

added added

removed removed

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