Hi, Im having some problems trying to check if a touch event was made or not.
[lua]local points = 0
local function pressChest (event)
if event.phase == “began” then
local tex = display.newText(“nah”,100,140,nil,40)
points = points +1
print (points)
return 1
end
end
if pressChest == 1 then
local pointsString = display.newText(points,200,200,nil,40)
end[/lua]
I also tried
[lua]local points = 0
local pointsString = display.newText(points,200,200,nil,40)
local function pressChest (event)
if event.phase == “began” then
local texto2 = display.newText(“nah”,100,140,nil,40)
pointsString.text = points +1
print (points)
return 1
end
end[/lua]
But it doesnt update, i have to click another button to update the score in the screen.
Any advice?
Thanks [import]uid: 108461 topic_id: 20469 reply_id: 320469[/import]