ya i do have poor design. its not my specialty.. for example. heres my entire character.h file
Code:
#ifndef CHARACTER_
#define CHARACTER_
#include "headers.h"
#include <string>
class Character
{
public:
//methods:
void Init(int NewX, int NewY, char NewChar);
void Draw();
int Walk(int newX, int newY);
void Attack(Character);
int GetHealth();
int GetX();
int GetY();
char GetName();
private:
//attributes
char name;
int Health;
int X;
int Y;
char ASCIICharacter;
};
class Monsters : public Character {
public:
void MonsterAI();
int DistanceToPlayerX(int curX, int PlayerX);
int DistanceToPlayerY(int curY, int PlayerY,Monsters *pBadGuy);
void MoveTowardsPlayer(int curX, int curY,Monsters *pBadGuy);
private:
Monsters * pBadGuy;
};
int Monsters::DistanceToPlayerX(int curX,int PlayerX){
*pBadGuy->GetX() = curX;
ASCIIMan.GetX() = PlayerX;
return (X+PlayerX);
};
int Monsters::DistanceToPlayerY(int curY,int PlayerY,Monsters *pBadGuy){
Y = curY;
ASCIIMan.GetY() = PlayerY;
return (Y+PlayerY);
void Monsters::MoveTowardsPlayer(int curX, int curY, Monsters *pBadGuy){\
//movement code
};
void Monsters::MonsterAI(){
if (DistanceToPlayer() < 1){
MoveTowardsPlayer();
};
};
#endif
//ignore distancetoplayerY, im waiting till i have a working distancetoplayerX and then just changing what i need.
does anybody have any tips on what i should do with this code to help debug it and properly design it?