I meant, actually printing out the values for score and highScore. This is a very simple function so something must be slipping through the cracks. As to my first suggestion, why don’t you set your variable values in the actual function, to make sure it’s working correctly. Then, you can move those hardcoded variables directly above the function being called. Then, you move the hardcoded values to the function that is setting the variables in the first place. Then you can track back where the breakdown has occurred.
I dont seem to follow … If i send you a zip file would you be able look it over and maybe get it working? everything is very simple in the file…
Did you read my post above?
Yes i did… but im getting so confused…
You have one variable called “score” that you track the current score in. You have another variable called “highScore” that you keep track of the high score in. Then you have a display.newText object that you use to show “score” (the one incremented every second) and another display.newText() that you want to show the high score with.
You are successfully incrementing “score” and showing that as well as resetting it. However in your button handler where you want to record the high score, you’re doing:
highScore = highScore + 0
instead of:
highScore = score
which is what you want to do to record the high score. That’s why your if statement isn’t working. You should also go back to my previous point and do the “else” model.
You have a second error when you go to display highScore. You’re not displaying highScore, but score.