breakhack/src/player.h

39 lines
780 B
C
Raw Normal View History

2017-11-30 21:00:47 +01:00
#ifndef PLAYER_H_
#define PLAYER_H_
#include <SDL2/SDL.h>
#include "sprite.h"
#include "stats.h"
#include "actiontext.h"
#include "camera.h"
2017-11-30 21:00:47 +01:00
enum PlayerClass { ENGINEER, MAGE, PALADIN, ROGUE, WARRIOR };
typedef enum PlayerClass class_t;
2017-12-15 08:08:45 +01:00
typedef struct Player_t {
Sprite *sprite;
ActionText *hitText;
ActionText *missText;
Stats stats;
2017-12-17 13:43:41 +01:00
unsigned int xp;
unsigned int total_steps;
unsigned int steps;
2017-12-21 08:31:25 +01:00
unsigned int hits;
unsigned int kills;
unsigned int misses;
2018-01-25 10:45:05 +01:00
double gold;
2017-12-15 08:08:45 +01:00
void (*handle_event)(struct Player_t*, RoomMatrix*, SDL_Event*);
} Player;
Player* player_create(class_t, SDL_Renderer*);
void player_hit(Player*, unsigned int dmg);
void player_reset_steps(Player*);
void player_render(Player*, Camera*);
2017-12-17 13:43:41 +01:00
void player_destroy(Player*);
2017-11-30 21:00:47 +01:00
#endif // PLAYER_H_