[Add] Making a start adding character health. Testing branches more than anything..

This commit is contained in:
Rtch90 2011-12-24 22:45:21 +00:00
parent 639b59da7e
commit 34d1b8f9e9
4 changed files with 19 additions and 9 deletions

View File

@ -58,6 +58,8 @@ void Player::HandleInput(void) {
void Player::Update(void) { void Player::Update(void) {
Move(); Move();
AddSpeachBubble("Woot, My name is Allanis, welcome to my home"); AddSpeachBubble("Woot, My name is Allanis, welcome to my home");
// For now The camera will be static. // For now The camera will be static.
//SetCamera(); //SetCamera();
} }

View File

@ -5,6 +5,7 @@
#include "Globals.h" #include "Globals.h"
#include "Constants.h" #include "Constants.h"
#include "../libUnuk/Character.h" #include "../libUnuk/Character.h"
#include "../libUnuk/Debug.h"
class Player : public Character { class Player : public Character {
public: public:
@ -26,6 +27,7 @@ private:
static const float PLAYER_SPEED; static const float PLAYER_SPEED;
string _name; string _name;
//int _health;
}; };
#endif #endif

View File

@ -13,7 +13,8 @@ Character::Character(Map* mapArg) {
_animationStage = ANIM_NO_FOOT; _animationStage = ANIM_NO_FOOT;
_animationTimer.Start(); _animationTimer.Start();
_leftFoot = false; _leftFoot = false;
_health = 100;
xVel = 0.0f; xVel = 0.0f;
yVel = 0.0f; yVel = 0.0f;

View File

@ -24,14 +24,17 @@ public:
void LoadSprites(string filename, int wArg, int hArg); void LoadSprites(string filename, int wArg, int hArg);
float GetX(void) { return x; } float GetX(void) { return x; }
float GetY(void) { return y; } float GetY(void) { return y; }
float GetWidth(void) { return w; } float GetWidth(void) { return w; }
float GetHeight(void) { return h; } float GetHeight(void) { return h; }
void SetXY(float xArg, float yArg) { x = xArg, y = yArg; } void SetXY(float xArg, float yArg) { x = xArg, y = yArg; }
void SetXVelocity(float arg) { xVel = arg; } void SetXVelocity(float arg) { xVel = arg; }
void SetYVelocity(float arg) { yVel = arg; } void SetYVelocity(float arg) { yVel = arg; }
void SetHealth(int health) { _health = health; }
int GetHealth(void) { return _health; }
void AddSpeachBubble(string text); void AddSpeachBubble(string text);
@ -58,6 +61,8 @@ protected:
Timer attackTimer; Timer attackTimer;
bool attacking; bool attacking;
int _health;
Map* map; Map* map;
@ -73,7 +78,7 @@ protected:
static const int ANIM_NO_FOOT = 1; static const int ANIM_NO_FOOT = 1;
static const int ANIM_RIGHT_FOOT = 2; static const int ANIM_RIGHT_FOOT = 2;
static const int ANIM_ATTACK = 3; static const int ANIM_ATTACK = 3;
private: private:
static const int ANIMATION_SPEED = 200; static const int ANIMATION_SPEED = 200;
static const int ATTACKING_DISPLAY_LEN = 150; static const int ATTACKING_DISPLAY_LEN = 150;