Hello all, just started learning corona and can’t figure this out myself. Don’t even know if my code is making any sense but here we go :
centerY = display.contentCenterY local gamescore = 0 function ChangeLeftButton() gamescore = gamescore + 1 local yp = {} yp[1] = centerY yp[2] = centerY + 20 yp[3] = centerY + 40 yp[4] = centerY + 60 if blankLeft.y == yp[1] then transition.to(blankLeft.y, {y = yp.."["..math.random(2,4).."]"}) elseif blankLeft.y == yp[2] then transition.to(blankLeft.y, {y = yp.."[1]" or yp.."["..math.random(3,4).."]" }) elseif blankLeft.y == yp[3] then transition.to(blankLeft.y, {y = yp.."[4]" or yp.."["..math.random(1,2).."]" }) elseif blankLeft.y == yp[4] then transition.to(blankLeft.y, {y = yp.."["..math.random(1,3).."]" }) end end function gameStarted() blankLeft = widget.newButton{ defaultFile = "blankball.png", x = centerX - 20, y = centerY, onPress = ChangeLeftButton } end