-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter.h
More file actions
26 lines (21 loc) · 736 Bytes
/
Character.h
File metadata and controls
26 lines (21 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef CHARACTER_H
#define CHARACTER_H
#include "raylib.h"
#include "BaseCharacter.h"
class Character : public BaseCharacter // Creating a class "Character" with member variables and member functions/ methods
{
public:
Character(int winWidth, int winHeight); // Create a Constructor
virtual void tick(float deltaTime) override;
virtual Vector2 getScreenPos() override;
Rectangle getWeaponCollisionRec() { return weaponCollisionRec; }
float getHealth() const { return health; }
void takeDamage(float damage);
private:
int windowWidth{};
int windowHeight{};
Texture2D weapon{LoadTexture("characters/weapon_sword.png")};
Rectangle weaponCollisionRec{};
float health{100.f};
};
#endif