So here I am working on a text game (Taking a break from Irrlicht) and one day this evil thing came into my room, the compiler error!
So it says...
FILENAME expected `;' before '(' token
In my Player Object with all the functions, which are:
Code:
class Player
{
public:
void walkNorth();
void walkSouth();
void walkEast();
void walkWest();
void inspect();
void checkStats();
void levelUp();
int setAttack(attack_value);
int setDefense(defense_value);
int setSpeed(speed_value);
int setHealth(health_value);
int setMaxHealth(max_health_value);
int ammoSet(weapon,ammo_value);
int expSet(exp_gain);
private:
int attack;
int defense;
int speed;
int health;
int mhealth;
int ammo[5];
int ammomax[5];
int exp;
int level;
};
The red snippets are what seem to be causing the problem, it repeats the compiler error for those lines, and I don't think it has to do with the actual function's data, but here you go.
Code:
int Player::setAttack(attack_value)
{
attack=attack_value;
}
int Player::setDefense(defense_value)
{
defense=defense_value;
}
int Player::setSpeed(speed_value)
{
speed=speed_value;
}
int Player::setHealth(health_value)
{
health=health_value;
}
int Player::setMaxHealth(max_health_value)
{
mhealth=max_health_value;
}
int Player::expAdd(exp_gain)
{
exp+=exp_gain;
}
int Player::ammoSet(weapon,ammo_value)
{
ammo[weapon]=ammo_value;
}
See, I don't know what I could POSSIBLY be doing wrong here, I am using Dev-C++ 4.9.9.2, and I HOPE I can stick with it. I am not entirely experienced in programming but I know a few good things on C++.
Thanks in advance.