1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
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
}
|