/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:
26
26
   maxVelocity = {x=velLimit,y=velLimit},
27
27
   minVelocity = {x=-velLimit, y=-velLimit},
28
28
   lastFired = 0,
 
29
   money = 2000, -- what to use for money symbol? ✪ or ☥ or Ⓐ?
 
30
   goods = {},
29
31
   onNew = function(self)
30
32
              self.thrust = Tile:new{image = 'data/thrust.png'}
31
33
           end,
58
60
                           b = Bullet:new{
59
61
                              x = self.x + self.width / 2,
60
62
                              y = self.y + self.height / 2,
 
63
                              rotation = self.rotation
61
64
                           }
62
65
                           self.lastFired = love.timer.getTime()
63
66
                     end
95
98
                        )
96
99
                     end
97
100
                  end
98
 
               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
99
114
}
 
 
b'\\ No newline at end of file'