how would I make a better fight? such as making a certain amount subtract from enemyHealth

Write your question here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  int main()
{
    int enemyHealth = 10;
    int attack = 1;
cout << "hit one to attack the enemy!\n";
    while (enemyHealth > 0){

int attack1;
cin >> attack1;
        switch (attack1) {

        case 1:
    enemyHealth --;
cout << "the enemy's health is now " << enemyHealth << endl;
        break;
        }

    }
    cout << "\n\n ------------------------------- \n\n\n you killed that mother f****r!";
}
If you were playing with traditional dice...

If you allow the occasional swing and a miss.
enemyHealth -= rand() % 6;

For an always hit.
enemyHealth -= rand() % 6 + 1;
Topic archived. No new replies allowed.