hey everyone,
i need a little help with a score, i used a simple score using
local left = 2
local leftText = display.newText(left, 200, 20, native.systemFont, 24)
leftText:setTextColor( 0, 0, 0 )
leftText.x = 40
leftText.y = 430
leftText.rotation = 90
localGroup:insert(leftText)
and then i used
left = left - 1
leftText.text = left
to subtract one when the enemy “died”.
My problem is when i made a winner Boolean value and a retry button, and when winner == true then the retry button comes into view and when the retry button is touch then a couple things happen including left resetting itself to 2. But when the game restarts, left still equals 0 for a moment until the collision happens again where left switches from 0 to 1 and then the next collision it just goes to -1 and so on further messing up the game.
any help or suggestions?
or more explanation needed?
Thanks.
[import]uid: 113909 topic_id: 21558 reply_id: 321558[/import]
)