Flower = Tile:extend{ image = 'data/flower32.png', name = 'flower', invTile = Tile:new{image = 'data/flower.png'}, onNew = function(self) --print(self.x, self.y, self.width, self.height) end, onCollide = function(self, other, xOl, yOl) if other == the.player then the.inventory:add(self) the.app.view:remove(self) end end } Fish = Sprite:extend{ name = 'fish', invTile = Tile:new{image = 'data/fish.png'}, onNew = function(self) --print(self.x, self.y, self.width, self.height) end, onCollide = function(self, other, xOl, yOl) if other == the.player then the.inventory:add(self) the.app.view:remove(self) end end } Flag = Sprite:extend{ name = 'flag', invTile = Tile:new{image = 'data/flag.png'}, onCollide = function(self, other, xOl, yOl) if the.inventory.items['flower'] then the.inventory:add(self) --the.app.view:remove(self) the.inventory:remove('flower') end self:displace(other) end } Fairy = Sprite:extend{ name = 'fairy', invTile = Tile:new{image = 'data/fairy.png'}, onCollide = function(self, other, xOl, yOl) if the.inventory.items['cat'] then the.inventory:add(self) the.inventory:remove('cat') end self:displace(other) end } Cat = Tile:extend{ image = 'data/cat.png', name = 'cat', invTile = Tile:new{image = 'data/cat48.png'}, onNew = function(self) --print(self.x, self.y, self.width, self.height) end, onCollide = function(self, other, xOl, yOl) if other == the.player then the.inventory:add(self) the.app.view:remove(self) end end }