I’m pretty new to this, and I would like to add score on touch of an object. Can anyone help me? Where can I create the base number that will change? Thanks in advance.
Here’s my code:
[lua]scoreText = display.newText( “Score”,350, 15, Font, 60)
local function redTouch(event)
if event.phase == “began” then
score = score + 1
scoreText.text = score
end
end
local function spawnRed()
local red = display.newImage(“red.png”)
physics.addBody( red, {density = 0.5, friction = 0.3} )
red.x = 208
red.y = -30
red:addEventListener( “touch”, redTouch )[/lua] [import]uid: 25216 topic_id: 11756 reply_id: 311756[/import]

I’m such a noob [import]uid: 25216 topic_id: 11756 reply_id: 43109[/import]