[Add] Adding some more method declarations to Actor.*
This commit is contained in:
parent
de6bd2d395
commit
1997e82ee1
@ -7,3 +7,15 @@ Actor::Actor(void) : VELOCITY(10.0f) {
|
||||
Actor::~Actor(void) {
|
||||
|
||||
}
|
||||
|
||||
void Actor::LoadSprite(const char* filename, float w, float h) {
|
||||
|
||||
}
|
||||
|
||||
void Actor::Update(void) {
|
||||
|
||||
}
|
||||
|
||||
void Actor::Render(void) {
|
||||
_actor->Draw();
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "../Sprite/Sprite.h"
|
||||
|
||||
class Actor {
|
||||
public:
|
||||
@ -18,6 +19,10 @@ public:
|
||||
Actor(void);
|
||||
~Actor(void);
|
||||
|
||||
void LoadSprite(const char* filename, float w, float h);
|
||||
void Update(void);
|
||||
void Render(void);
|
||||
|
||||
float GetX(void) { return x; }
|
||||
float GetY(void) { return y; }
|
||||
float GetWidth(void) { return w; }
|
||||
@ -25,10 +30,24 @@ public:
|
||||
|
||||
void SetXY(float xArg, float yArg) { x = xArg; y = yArg; }
|
||||
|
||||
private:
|
||||
int GetDirection(void) { return _direction; }
|
||||
void SetDirection(int direction) { _direction = direction; }
|
||||
|
||||
protected:
|
||||
const float VELOCITY;
|
||||
|
||||
int _direction;
|
||||
|
||||
static const int ANIM_LEFT_FOOT = 0;
|
||||
static const int ANIM_NO_FOOT = 1;
|
||||
static const int ANIM_RIGHT_FOOT = 2;
|
||||
static const int ANIM_ATTACK = 3;
|
||||
|
||||
private:
|
||||
float x;
|
||||
float y;
|
||||
float w;
|
||||
float h;
|
||||
|
||||
Sprite* _actor;
|
||||
};
|
||||
|
@ -10,21 +10,6 @@ class SoundEffect;
|
||||
// We will derive from an Actor class at some point.
|
||||
class Player {
|
||||
public:
|
||||
// Facing enum controls which spritr to render.
|
||||
enum Facing {
|
||||
LEFT,
|
||||
RIGHT,
|
||||
NONE
|
||||
};
|
||||
|
||||
// Control the current state the character is in.
|
||||
enum Status {
|
||||
STANDING = 0,
|
||||
WALKING,
|
||||
HURT,
|
||||
DEAD,
|
||||
};
|
||||
|
||||
Player(void);
|
||||
~Player(void);
|
||||
|
||||
@ -47,8 +32,6 @@ private:
|
||||
Sprite* _player;
|
||||
float _rotationAngle;
|
||||
|
||||
Facing _preventMovement;
|
||||
|
||||
SoundEffect* _stepSFX[4];
|
||||
int _lastStepSFXPlayed;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user