Score sets to the 10's digit. EDIT: SOLVED
So i have a score function in my game, it works perfectly in the game but when the game ends and you got to the game over page, the 10's digit always remembers what you got on your first try. For example, on first go you get 180, second go if you were to get 234, it would set it to 284 because 8 was the digit from before. What is wrong and how can I fix this?
Sorry if i wasn't very clear,
Thanks
Sorry if i wasn't very clear,
Thanks

Comments
: )
I think for these kinds of questions you need to at least give people a few clues, even if it's just the very basics of how you have this set up, otherwise it's all a bit: "I have a box moving and it hits this other guy but is meant to explode and doesn't do it properly, what am I doing wrong ?"
I bet you with people like Tshirtbooth around a screen shot of the offending code would be enough for him to spot the mistake in 30 seconds, but without knowing what is going on in your project people can only guess.
Here's my guess, your problem is with the way you have set up the 3 attributes that control where the 0 is added to the final score from level 1.
How did I do ?
: P
The coding for each is as follows:
Constrain attribute: self.image :floor(( game.Highscore % self.Div )/( self.Div /10))
In the units I have Div 10, 10's I have Div 100, 100's I have Div 1000 and 1000's I have Div 10000.
The coding for the score is: After gamestart is true, every 0.2 seconds change game.score to game.score +1
The coding for the highscore is: When game.score > game.highscore, change attribute: game.highscore to game.score. Then save attribute game.highscore with key highscore.
Hope this helps
PS the score is made up of images not the set fonts.