Somehow I'm just keep getting this error:
player.cpp(6): error C2143: syntax error : missing ';' before '.'
Here's the header file
#ifndef Enemy
#define Enemy
#include "SDLGameObject.h"
class Enemy : public SDLGameObject
{
public:
Enemy(const LoaderParams* pParams): SDLGameObject(pParams) {}
void draw();
void update();
void clean() {}
};
#endif
$Here's the Enemy.cpp file:
#include "Enemy.h"
void Enemy::draw()
{
SDLGameObject.draw();
}
void Enemy::update()
{
m_x -= 1;
m_currentFrame = int(((SDL_GetTicks() / 100) % 6));
}
$Here's the SDLGameObject.h that is the base class of Enemy
#ifndef __SDLGameObject__
#define __SDLGameObject__
#include "GameObject.h"
#include <string>
class SDLGameObject : public GameObject
{
public:
SDLGameObject(const LoaderParams* pParams);
virtual void draw();
virtual void update();
virtual void clean();
protected:
int m_x;
int m_y;
int m_width;
int m_height;
int m_currentRow;
int m_currentFrame;
std::string m_textureID;
};
#endif
And GameObject.h is just the abstract base class of SDLGameObject.h
I'm not sure whether to include it, but it seems the error lies in the Enemy.cpp file.
I'd really appreciate for your help since I'm pretty new at this. Thanks everyone :)))