bzr branch
http://9ix.org/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) |
|
44
by Josh C
drop |
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 |
|
42
by Josh C
be moved |
20 |
|
44
by Josh C
drop |
21 |
--v.tween:start(f, 'x', fairytarget2.x, 5) |
22 |
--v.tween:start(f, 'y', fairytarget2.y, 5) |
|
23 |
end) |
|
24 |
-- :andThen... |
|
42
by Josh C
be moved |
25 |
end |
26 |
end |
|
27 |
} |