/ld26

To get this branch, use:
bzr branch /bzr/ld26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FairyActivator = Sprite:extend {
   onCollide = function(self, other, xOl, yOl)
                  self:displace(other)

                  if the.inventory.items['fairy'] then
                     the.inventory:remove('fairy')

                     local v = the.app.view
                     local f = RealFairy:new{x = the.player.x, y = the.player.y}
                     v:add(f)

                     the.player.canMove = false

                     v.tween:start(f, 'x', fairytarget.x, 5)
                     v.tween:start(f, 'y', fairytarget.y, 5)

                  end
               end
}