[Add] Initial actor base class.
This commit is contained in:
parent
ac0b5785a3
commit
de6bd2d395
@ -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
9
src/Actor/Actor.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "Actor.h"
|
||||
|
||||
Actor::Actor(void) : VELOCITY(10.0f) {
|
||||
|
||||
}
|
||||
|
||||
Actor::~Actor(void) {
|
||||
|
||||
}
|
34
src/Actor/Actor.h
Normal file
34
src/Actor/Actor.h
Normal 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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user