Hi there,
For starters I am new to Corona (and programming in general) . I am not getting my head around something (probably simple), I try to do the following. Coming from the Corona example script of the pool table, I would like to use the “applyForce” on the cue ball in a similar matter, BUT I would like to install a pause sequence before the ball fires (as I want to fire up some animation before the shot is fired) So pause after drag ends and then after pause use “applyForce”. This should be done by something like timer.performWithDelay… (I was thinking)
I have tried this:
if event.phase == ended
-- some other code handling animation here
t:applyForce( (t.x - event.x), (t.y - event.y), t.x, t.y )
timer.performWithDelay (5000, cueShot, 1)
end
Runtime:addEventListener( "cueShot", applyForce )
but I am doing it basically wrong (applyForce is not a function?)
trying to wrap it in a function like so under
if event.phase == ended
-- some other code handling animation here
-- and then
function delayShot (self, event)
t:applyForce( (t.x - event.x), (t.y - event.y), t.x, t.y )
timer.performWithDelay (5000, delayShot, 1)
end
does only delay the animation of the rotation, not the actual shot.
Can anybody tell me what I am doing wrong? Thnx a lot
[import]uid: 193590 topic_id: 34104 reply_id: 334104[/import]