I have a scoreText.score code and it works great but I don’t know how to reset it back to 0 after the user hits “retry”.
I have the variable set up and the point system working. The thing that makes it tough is I don’t know many points the user will get so I can’t just subtract it. I tried just coding “score = 0” but I caught another apple(a point) and it added to the previous score.
The code…
[code]
local score = 0
–the text
local apple = display.newImage ( “Red Apple.png” )
physics.addBody(apple, {density=3.0})
apple.x = -30
apple.y = 370
apple.name = “apple”
–and this is what I have in between if-then statements
scoreText.text = score
score = score + 1
[import]uid: 59140 topic_id: 13969 reply_id: 313969[/import]