When I click on my object to increase the score the score increase but overlaps the score that was there before making it impossible to read it. Any idea why this is happening?
[lua]local score = 0
background = display.newRect(175,100,1000,1000)
background:setFillColor(.2,.5,.1)
pile = display.newImageRect(“bill.jpg”,200,400)
pile.x = display.contentCenterX
pile.y = display.contentCenterY + 200
function add(event)
if event.phase == “began” then
score = score + 1
scoreText = display.newText(score,display.contentCenterX,50,“helvetica”,20)
print(score)
end
return true
end
pile:addEventListener(“touch”,add)[/lua]