The score in my game doesn't display as I expected

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
hightech
Posts: 37
Joined: December 7th, 2014, 9:45 pm

The score in my game doesn't display as I expected

Post by hightech » March 16th, 2015, 9:10 pm

Hello all ! Well, I included a timer and a score in my game ( they are both displayed ) but when I start the game the score is already 1 and when I press the PLAY button in my game the score becomes 2 - I want it to be 0 until I collect a circle( like the poo game ). The problem might be in the ResetGoal func - http://pastebin.com/rSeSsEQG . This is how I drew the score - http://pastebin.com/ebK5F41y .
Unfortunately the project is 72 MB and I cannot upload it.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: The score in my game doesn't display as I expected

Post by albinopapa » March 16th, 2015, 9:50 pm

already gave you the answer in PM. In the Game constructor you call ResetGoal, which increments nGoal, and in StartGame you call ResetGame which calls ResetGoal which increments nGoal.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply