I am now getting a vtable error for my enemy class in my rpg game. It says undefined refernce to 'Vtable for Enemy' . I'm thinking its my constructor that is going wrong with the Enemy class. I've tried almost everything but kept getting stumped on a problem. Here is my enemy.cpp class
#ifndef MONSTER_H
#define MONSTER_H
#include "Enemy.h"
class Monster : public Enemy
{
Monster();
Monster(int MonsterHealth, int MonsterMana,int Monstersize,int Monsterenemymana);
void TheenemyHealth()
{
int Enemyhealth = 100;
}
int EnemyDamage(int EnemyAttack){
int Attack = EnemyAttack;
Attack = 5;
}
int dropxp(int enemyxpdrop);
private:
int Health = 0;
int Mana = 0;
};
#endif // MONSTER_H
So the probelem lies within the constructors ,but I don't know which one and why. I don't mind you changing up my entire code I love improvements towards everything I do.
You're not defining Enemy::dropxp(int enemydropxp); :)
also you may want to look up abstract classes! It'll probably fit your situation a little better but you be the judge.