Im trying to make a new image appear after I click on one and they all move down and have a new one appear in a random location in the empty column, if that makes any sense lol. Any ideas what I’m missing here?
local function jump(event)
if event.phase == “began” then
frog.x = event.target.x
frog.y = event.target.y
frog:toFront()
for i = numberOfLily,1,-1 do
lily[i].y = lily[i].y + 160
frog.y = lily[i].y
local col = math.random(columnCount) – Choose a column randomly
end
lilyLocations[1].x = (col * 160) - 80 – subtracting imgSize to start from 0
lilyLocations[1].y = i * 160
lily[1] = display.newImageRect(“lily.png”, 160, 160)
lily[1].x = display.contentCenterX
lily[1].y = display.contentCenterY
lily[1].x = lilyLocations[1].x
lily[1].y = lilyLocations[1].y
end
return true
end