Hi,
I’m trying to create a simple text field which displays the score on screen:
score = 0
local scoreText = display.newText( "Score: " … score, 20, 0,nil, 20)
scoreText:setTextColor(255,255,255)
I then use a simple function:
local function getScore() – increments score value every time it is called
score = score + 1
print( “score” … score )
end
The problem is that the function doesn’t pass the data back to the “score” variable.
Can anyone shed any light on this? I’m sure it’s just me not thinking right.
Thanks
Dan [import]uid: 67933 topic_id: 12483 reply_id: 312483[/import]
[import]uid: 52491 topic_id: 12483 reply_id: 45590[/import]