A little scenario:
a ship is moving and the player select a new goal (tile) for the ship to move to.
The first thing is to check if the ship is doing a transition, and if this is true:
It’s a tile map so the transition have to go on to the middle of the next tile and after this i have to delete the old transition (transition.cancel()) and make an new transition to the new goal. right?
i tried the transition oncomplete function but this i don’t get it to work:
shiptransition = transition.to(ship1, {delay = mem ,time=900\*speed, x=xto, y=yto, onComplete=listener1 });
local listener1 = function ( ship1 )
print( "Transition 2 completed on object: " )
end
if shiptransition then
clicked = 1
Print(“is moving”)
End
In the same function above the transition code but the output is always ‘is moving’ even if the transition has already ended! [import]uid: 18622 topic_id: 32535 reply_id: 129459[/import]
if shiptransition then
clicked = 1
Print(“is moving”)
End
In the same function above the transition code but the output is always ‘is moving’ even if the transition has already ended! [import]uid: 18622 topic_id: 32535 reply_id: 129459[/import]
i have to set this to nil because the program uses if (shiptransition) then.
i get the runtime error 'attempt to index a nil value in function ‘cancel’.
i’ve been searching and trying since yesterday now but couldn’t find the solution (i don’t even know why the terminal is giving me this error). [import]uid: 18622 topic_id: 32535 reply_id: 130156[/import]
i have to set this to nil because the program uses if (shiptransition) then.
i get the runtime error 'attempt to index a nil value in function ‘cancel’.
i’ve been searching and trying since yesterday now but couldn’t find the solution (i don’t even know why the terminal is giving me this error). [import]uid: 18622 topic_id: 32535 reply_id: 130156[/import]