[Add] Initial actor base class.

This commit is contained in:
Rtch90 2012-04-12 18:55:13 +01:00
parent ac0b5785a3
commit de6bd2d395
3 changed files with 47 additions and 2 deletions

View File

@ -54,7 +54,8 @@ HEADERS += ../src/Actor/Player.h \
../src/TMXParser/base64.h \
../src/Collision/TileCollision.h \
../src/Actor/NPC.h \
../src/Sound/SoundEffect.h
../src/Sound/SoundEffect.h \
../src/Actor/Actor.h
SOURCES += ../src/Actor/Player.cpp \
../src/Collision/AABB.cpp \
../src/Global/Globals.cpp \
@ -85,5 +86,6 @@ SOURCES += ../src/Actor/Player.cpp \
../src/TMXParser/TmxImage.cpp \
../src/TMXParser/base64.cpp \
../src/Actor/NPC.cpp \
../src/Sound/SoundEffect.cpp
../src/Sound/SoundEffect.cpp \
../src/Actor/Actor.cpp
OTHER_FILES +=

9
src/Actor/Actor.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "Actor.h"
Actor::Actor(void) : VELOCITY(10.0f) {
}
Actor::~Actor(void) {
}

34
src/Actor/Actor.h Normal file
View File

@ -0,0 +1,34 @@
#pragma once
class Actor {
public:
enum State {
WALKING,
RUNNING,
ATTACKING,
};
enum Facing {
FRONT,
BACK,
LEFT,
RIGHT
};
Actor(void);
~Actor(void);
float GetX(void) { return x; }
float GetY(void) { return y; }
float GetWidth(void) { return w; }
float GetHeight(void) { return h; }
void SetXY(float xArg, float yArg) { x = xArg; y = yArg; }
private:
const float VELOCITY;
float x;
float y;
float w;
float h;
};