[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,6 +13,7 @@ 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

@ -33,6 +33,9 @@ public:
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);
void Render(void); void Render(void);
@ -59,6 +62,8 @@ protected:
Timer attackTimer; Timer attackTimer;
bool attacking; bool attacking;
int _health;
Map* map; Map* map;
static const float CHARACTER_SPEED; static const float CHARACTER_SPEED;