I must be going crazy... I can't figure out why I'm getting these errors...
#ifndef RUDEY_ENEMY_H
#define RUDEY_ENEMY_H
#include "SDL/SDL.h"
#include "Cloneable.h"
#include "Direction.h"
#include "Drawable.h"
#include "SDL_Tools.h"
#include "Updateable.h"
#include "XImage.h"
#include "Rudey_Clock.h"
#include "Rudey_Level.h"
class Rudey_Enemy : public XImage
{
public:
Rudey_Enemy();
Rudey_Enemy(
int speed,
const std::string& name,
const std::string& file_name,
Point xy,
bool is_colour_key,
SDL_Colour colour_key = SDL_Tools::colour(255,255,255));
virtual ~Rudey_Enemy();
int Get_Speed() const;
void Move(Direction::DIRECTION dir);
public:
virtual void Draw();
virtual void Update(const SDL_Event& event_);
//virtual Rudey_Enemy* Clone() const;
private:
int speed;
};
#endif
#include "Rudey_Enemy.h"
Rudey_Enemy::Rudey_Enemy()
:
speed(0)
{
}
Rudey_Enemy::Rudey_Enemy(
int speed,
const std::string& name,
const std::string& file_name,
Point xy,
bool is_colour_key,
SDL_Colour colour_key)
:
XImage(name, file_name, xy.x, xy.y, is_colour_key, colour_key),
speed(speed)
{
position.w = SDL_Tools::get_surface_size(surface).x;
position.h = SDL_Tools::get_surface_size(surface).y;
}
Rudey_Enemy::~Rudey_Enemy()
{
}
int Rudey_Enemy::Get_Speed() const
{
return speed;
}
void Rudey_Enemy::Move(Direction::DIRECTION dir)
{
position = SDL_Tools::move_by(position, dir, Rudey_Level::TILE_WIDTH);
}
void Rudey_Enemy::Draw()
{
Draw_Engine::Blit_Surface(position, surface, NULL);
}
void Rudey_Enemy::Update(const SDL_Event& event_)
{
//if(Rudey_Clock::Get_Ticks() >= speed)
//{
// // move some random position
//}
}
//Rudey_Enemy*; Rudey_Enemy::Clone() const
//{
// return new Rudey_Enemy(*this);
//}
#ifndef RUDEY_LEVEL_H
#define RUDEY_LEVEL_H
#include <vector>
#include <string>
#include "Rudey.h"
#include "Rudey_Clock.h"
#include "Rudey_Enemy.h"
class Rudey_Level
{
public:
Rudey_Level();
Rudey_Level(Rudey* rudey, int difficulty);
~Rudey_Level();
static int TILE_WIDTH, TILE_HEIGHT;
private:
Rudey* rudey;
int difficulty;
std::vector<Rudey_Enemy> enemies;
};
#endif
#include "Rudey_Level.h"
int Rudey_Level::TILE_WIDTH = 25;
int Rudey_Level::TILE_HEIGHT = 25;
Rudey_Level::Rudey_Level()
:
rudey(NULL),
difficulty(0)
{
}
Rudey_Level::Rudey_Level(Rudey* rudey, int difficulty)
:
rudey(rudey),
difficulty(difficulty)
{
}
Rudey_Level::~Rudey_Level()
{
}
Quote:error C2146: syntax error : missing ';' before identifier 'r' 23
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 23
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 23
Cheers.