1
Inventory = Class:extend {
6
add = function(self, item)
7
self.items[item.name] = item
8
the.app.view:flash({0,255,0})
11
item.invTile.x = 50 * self.nitems
13
self.nitems = self.nitems + 1
15
remove = function(self, name)
16
self.had[name] = self.items[name]
17
self.items[name] = nil
18
self.nitems = self.nitems - 1
21
for _, item in pairs(self.items) do
22
item.invTile.x = 50 * newindex
23
newindex = newindex + 1
27
for _, item in pairs(self.items) do
33
the.inventory = Inventory:new()