Hello
I hope someone can help me:
I ve 2 texts
local x= { 200, 60, 20, } local testo1 = display.newText("Rosso" , 40 , 170 , "HoboStd" , 24) testo1:setFillColor(0 , 200 , 0 ) gruppo:insert(testo1) local testo2 = display.newText("Blu" , 40, 170, "HoboStd" , 24) testo2:setFillColor(200 , 0 , 0 ) gruppo:insert(testo2) function skip(event) if event.phase == "began" then testo1.x = x[math.random(1,3) testo2.x = x[math.random(1,3) end end Runtime:addEventListener("touch" , skip)
But in this way it is possible that the 2 texts have the same x coordinates and I want to avoid this. How can i do this still using the math.random function??
I SOLVED THANKS ANYWAY :)))