This code crashes my game, any idea why?
local x,y,touching,active = 2,2,false,true
local background = display.newImage(“Icon.png”,(display.pixelWidth/2)+30,(display.pixelHeight/2)+30)
background:scale(60,60)
print(“Started”)
function onObjectTouch(event)
if event.phase == “began” then
touching = true
elseif event.phase == “ended” then
touching = false
end
return true
end
background:addEventListener(“touch”,onObjectTouch)
while active == true do
if touching == true then
y = y + 1
elseif touching == false then
y = y - 1
end
end
