I am creating a game when the player lands on "F", the enumeration in the player class has to change between good and bad.
For example, if the player already has good and lands on "F", it will change to bad, and if players lands back on 'F' it will be good again and so on.
player.h
class Player {
public:
int health = 100;
int weapon = 1;
int lvl = 0;
Player(bool hero) {
if (hero) {
health;
weapon;
} else {
health = 1;
}
}
enum Alignment { good, bad };
void attack(Enemy &e);
friend class Enemy;
};
main.cpp
if (gameBoard[positionX][positionY] == gameBoard[0][4]) {
cout << "\nWell Of Reflection\n" << endl;
cout << "You increases your XP by 2" << endl;
p.lvl += 2;
cout << "Total XP: " << p.lvl << endl;
Alignment = // HERE
}