Decrement not working

Hi,

I have created a game that uses this turn logic as it progresses however the turnCounter won't seem to countdown.

I have a created a countdown function that should keep decreasing the turnCounter but it doesn't seem to work.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
	while (!gameOver)
        {
          game->countdown();
          if(game->getTurnCounter() <= 0){
              gameOver = true;
          }
        }



// countdown function
void Difficulty::countdown(){

	turnCounter--;
}


Any ideas?
Hi,

How does getTurnCounter() access a Difficulty object? What type is game?

Hope this has helped a bit, and all goes well :+)
Topic archived. No new replies allowed.