SCORE

Hi,

I have a score that adds down every time you move an object, until 0. The problem i have is every time it counts down, the numbers start piling up on top of each other. They are not even noticeable,is there an way to fix this? To remove the previous score, so you can see the next?

Thanks. [import]uid: 23689 topic_id: 13732 reply_id: 313732[/import]

it must be something like this, i suppose
[lua]local score = 100
local scoreTxt = display.newText("",100,50,native.systemFont,20)
local obj = display.newRect(0,0,50,50)
obj.x = 150; obj.y = 150

local function addscore(event)
obj.x = event.x
if score > 0 then
score = score - 1
scoreTxt.text = score
end
end
obj:addEventListener(“touch”, addscore)[/lua] [import]uid: 16142 topic_id: 13732 reply_id: 50472[/import]