/ld26

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

« back to all changes in this revision

Viewing changes to items.lua

  • Committer: Josh C
  • Date: 2013-04-29 01:00:59 UTC
  • Revision ID: josh@9ix.org-20130429010059-8ezjqeuyx8fzpd6c
don't kill trolls

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
                     the.app.view:remove(self)
26
26
                  end
27
27
               end
28
 
}
 
 
b'\\ No newline at end of file'
 
28
}
 
29
 
 
30
Flag = Sprite:extend{
 
31
   name = 'flag',
 
32
   invTile = Tile:new{image = 'data/flag.png'},
 
33
   onCollide = function(self, other, xOl, yOl)
 
34
                  if the.inventory.items['flower'] then
 
35
                     the.inventory:add(self)
 
36
                     --the.app.view:remove(self)
 
37
 
 
38
                     the.inventory:remove('flower')
 
39
                  end
 
40
 
 
41
                  self:displace(other)
 
42
               end
 
43
}
 
44
 
 
45
Fairy = Sprite:extend{
 
46
   name = 'fairy',
 
47
   invTile = Tile:new{image = 'data/fairy.png'},
 
48
   onCollide = function(self, other, xOl, yOl)
 
49
                  if the.inventory.items['cat'] then
 
50
                     the.inventory:add(self)
 
51
 
 
52
                     the.inventory:remove('cat')
 
53
                  end
 
54
 
 
55
                  self:displace(other)
 
56
               end
 
57
}
 
58
 
 
59
Cat = Tile:extend{
 
60
   image = 'data/cat.png',
 
61
   name = 'cat',
 
62
   invTile = Tile:new{image = 'data/cat48.png'},
 
63
   onNew = function(self)
 
64
              --print(self.x, self.y, self.width, self.height)
 
65
           end,
 
66
   onCollide = function(self, other, xOl, yOl)
 
67
                  if other == the.player then
 
68
                     the.inventory:add(self)
 
69
                     the.app.view:remove(self)
 
70
                  end
 
71
               end
 
72
}