Im pretty new to Corona and programming in general, but I am working on a game, and my scoring system isnt working…I want the score to change and increase on the screen but the only way i was able to do this was to have the score + 1 appearing on top of the score so there are about 500 numbers overlayed on top of each other in about a minute.
The way I got around this was to put a black box behind the number(shown in the code as rightScoreBack or ScoreBack) which make a new black box appear almost as much as the numbers so that when each number would appear, the black box would go on top of it so you could see the next number.
Here is my code:
score = 0
local rightScoreBack = display.newImage(“scoreback.png”, 0, 15)
rightScoreBack.xScale = 1.5
rightScoreBack.yScale = 1.5
local function updateScore()
score = score + 1
local scoreNumber = display.newText(score, 200, 0, nil, 50)
scoreNumber.xScale = 1.2
scoreNumber.yScale = 1.2
end
timer.performWithDelay(1, updateScore, -1)
local scoreText = display.newText(“score:”, 0, 0, nil, 50)
scoreText.xScale = 1.2
scoreText.yScale = 1.2
function updateScoreback(event)
local scoreBack = display.newImage(“scoreback.png”, 190, 15)
scoreBack.yScale = 1.5
end
timer.performWithDelay(1, updateScoreback, -1)
Any suggestions or better ways of doing this?
Thanks