/ld26

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

« back to all changes in this revision

Viewing changes to fairyactivator.lua

  • Committer: Josh C
  • Date: 2013-04-28 17:38:34 UTC
  • Revision ID: josh@9ix.org-20130428173834-ps7dq286wp4gdpd0
bridge

Show diffs side-by-side

added added

removed removed

Lines of Context:
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):andThen(function()
16
 
                     --( --   <-- delete this
17
 
                        the.player.canMove = true
18
 
                        f:die()
19
 
                        --f.carryingPlayer = false
20
 
 
21
 
                        --v.tween:start(f, 'x', fairytarget2.x, 5)
22
 
                        --v.tween:start(f, 'y', fairytarget2.y, 5)
23
 
                     end)
24
 
                     -- :andThen...
25
 
                  end
26
 
               end
27
 
}
 
 
b'\\ No newline at end of file'