I have coded this app but i don’t understand why it doesn’t work
local option = { width = 104, height = 67, numFrames = 7, } local sheet = graphics.newImageSheet( "nuota.png", option) local animazione = {name = "swim" , start = 1 , count= 7, time = 300, loopCount = 0} local swim = display.newSprite( sheet , animazione) swim.x = 128 swim.y= 119 function muoviti() transition.to(swim, {time = math.random(45000 , 50000) , x = 984 }) end muoviti() function loose() if swim.x == 300 then print("you loose") end end loose()
But when the swim.x is 300 the simulator doesn’t show me " you loose"