Need help with text based game!

This game is not even close to ready because i just started it and I got stuck on this one part. What I need help with is that i can't seem to make the stats go up with time. For example I want the population in the game to go up by 5 every minute or so, This is what I need help on so if anyone can help then I will take any advice and thank you in advance.

Also this is a very different style then many other text based games I have seen use so that is why it is a little trickier.

This is the code so far if you want to glance at it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <string>
using namespace std;

int main()
{
    cout << "-_-[ Kinkdoms of the Dwarf Lords ]-_-" << endl;
    int op1;
    cout << "commands:" << endl;
    cout << "1 = stats" << endl;
    cout << "2 = supplies" << endl;

    bool bExit = false;
do
{
    cout << "-> ";
    cin >> op1;
    switch(op1)
    {
    case 1:
        cout << "level: 1" << endl;
        cout << "Money: 500" << endl;
        cout << "Population: 10" << endl;
        break;
    case 2:
        cout << "you have no supplies" << endl;
        break;
    default:
        cout << "Error- That is an Invalid input, only 1, or 2 allowed" << endl;
    }
} while (!bExit);


    return 0;
}
Last edited on
while your program is running every time you enter an option execute some function that checks how many time has past since the last time it was checked. and adds like 1 population or whatever for every second that has past by.
Topic archived. No new replies allowed.