/ld26

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

« back to all changes in this revision

Viewing changes to inventory.lua

  • Committer: Josh C
  • Date: 2013-04-28 05:19:04 UTC
  • Revision ID: josh@9ix.org-20130428051904-7j0sucv9tm8rqdkf
inventory (and a flower)

Show diffs side-by-side

added added

removed removed

 
1
Inventory = Class:extend {
 
2
   items = {},
 
3
   visible = true,
 
4
   add = function(self, item)
 
5
            item.invTile.y = 10
 
6
            item.invTile.x = 50 * #self.items
 
7
            self.items[item.name] = item
 
8
         end,
 
9
   draw = function(self)
 
10
             for _, item in pairs(self.items) do
 
11
                item.invTile:draw()
 
12
             end
 
13
          end
 
14
}
 
15
 
 
16
the.inventory = Inventory:new()