Hey, I’m pretty new to corona I starting learning 2 days ago I’m really starting to get it. I’m just having one small issue. I have multiple characters a total of 4 and when you tap on them I want them to just straight down then right back up. I tried doing a transition but when I applied a transition to the other image it would not work. then I tried indexing the transitions but that also didn’t work the first image would do it right but the second one would not come back up after it went down
Here’s the current code I have right now. I would appreciate all the help thank you!
local trans2
local ts = {2}
local index = 1
local Pepesad = display.newImageRect( “Pepesad.png”, 50, 50 )
Pepesad.x = 270
Pepesad.y = 450
function Pepesad:tap ( event )
ts[Pepesad.tIndex] = transition.to(Pepesad, { time=2500, x=270, y=500, onComplete=trans2 })
end
trans2 = function ()
ts[Pepesad.tIndex] = transition.to(Pepesad, { time=2500, x=270, y=450, onComplete=trans1 })
end
Pepesad.tIndex = index
Pepesad:tap( event )
index = index + 1
Pepesad:addEventListener( “tap”, Pepesad )
local Pepehappy = display.newImageRect( “Pepehappy.png”, 50, 50 )
Pepehappy.x = 50
Pepehappy.y = 450
function Pepehappy:tap ( event )
ts[Pepehappy.tIndex] = transition.to(Pepehappy, { time=2500, x=50, y=500, onComplete=trans2 })
end
trans2 = function ()
ts[Pepehappy.tIndex] = transition.to(Pepehappy, { time=2500, x=50, y=450, onComplete=trans1 })
end
Pepehappy.tIndex = index
Pepehappy:tap( event )
index = index + 1
Pepehappy:addEventListener( “tap”, Pepehappy )