/ld26

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

« back to all changes in this revision

Viewing changes to inventory.lua

  • Committer: Josh C
  • Date: 2013-04-28 18:52:04 UTC
  • Revision ID: josh@9ix.org-20130428185204-auxrflmqghvti2zm
put levels in their own file

Show diffs side-by-side

added added

removed removed

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