/ld26

To get this branch, use:
bzr branch /bzr/ld26
42 by Josh C
be moved
1
FairyActivator = Sprite:extend {
2
   onCollide = function(self, other, xOl, yOl)
3
                  self:displace(other)
4
5
                  if the.inventory.items['fairy'] then
6
                     the.inventory:remove('fairy')
7
8
                     local v = the.app.view
9
                     local f = RealFairy:new{x = the.player.x, y = the.player.y}
10
                     v:add(f)
11
12
                     the.player.canMove = false
13
14
                     v.tween:start(f, 'x', fairytarget.x, 5)
15
                     v.tween:start(f, 'y', fairytarget.y, 5)
16
17
                  end
18
               end
19
}