Hi, I’m absolutely new to this. I can code a bit of Jquery (enough to build web interfaces) and PHP, so Corona SDK was easy for me to understand, or at least to read.
I was trying to follow a whack-a-mole tutorial I found somewhere and without reading the code I tried to program it myself.
I wanted to make the moles go up and down and after a bit of searching I went with the transition.to() function with no luck at all.
Then I gave up and went back to the tutorial to see how it was done and I finally got it working.
The problem I have is understanding why my way didn´t work. Here´s the code.
THIS WORKS:
local function moveMoleDown() mole1.transition=transition.to(mole1,{ time=500, y=237}) end local function moveMoleUp() mole1.transition=transition.to(mole1,{ time=500, y=137, onComplete=moveMoleDown}) end moveMoleUp()
THIS DOESN¨T
mole2.transition=transition.to(mole2,{ time=500, y=237}) mole2.transition=transition.to(mole2,{ time=500, y=137})
In the first case I have to build to functions (UP and DOWN) and when the mole is up, I have to call the down function.
In the second case I move the mole UP with a transition but can´t get it DOWN with the same command.
I know this may sound really stupid, but I´m just starting.
Thanks!