/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-16 04:21:01 UTC
  • Revision ID: josh@9ix.org-20130616042101-tp1rddbd3subc8lg
enemy is back

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
   minVelocity = {x=-velLimit, y=-velLimit},
28
28
   lastFired = 0,
29
29
   money = 2000, -- what to use for money symbol? ✪ or ☥ or Ⓐ?
 
30
   goods = {},
30
31
   onNew = function(self)
31
32
              self.thrust = Tile:new{image = 'data/thrust.png'}
32
33
           end,
59
60
                           b = Bullet:new{
60
61
                              x = self.x + self.width / 2,
61
62
                              y = self.y + self.height / 2,
 
63
                              rotation = self.rotation
62
64
                           }
63
65
                           self.lastFired = love.timer.getTime()
64
66
                     end
96
98
                        )
97
99
                     end
98
100
                  end
99
 
               end
 
101
               end,
 
102
   buy = function(self, good, price)
 
103
            if self.money >= price then
 
104
               self.goods[good] = (self.goods[good] or 0) + 1
 
105
               self.money = self.money - price
 
106
            end
 
107
         end,
 
108
   sell = function(self, good, price)
 
109
             if self.goods[good] and self.goods[good] > 0 then
 
110
                self.goods[good] = self.goods[good] - 1
 
111
                self.money = self.money + price
 
112
             end
 
113
          end
100
114
}
 
 
b'\\ No newline at end of file'