added functionnal health component

This commit is contained in:
Clément Le Bihan
2020-04-01 16:56:09 +02:00
parent ff93ae0513
commit 3e50e0e19c
4 changed files with 42 additions and 6 deletions
+8 -1
View File
@@ -8,14 +8,21 @@
#ifndef MY_RPG_HEALTH_COMPONENT_H
#define MY_RPG_HEALTH_COMPONENT_H
#include <stdbool.h>
#include "component.h"
struct health_component
{
gc_component base;
unsigned int health;
int health;
bool dead;
};
void add_health(struct health_component *this, gc_engine *engine, \
unsigned int amount);
void rem_health(struct health_component *this, gc_engine *engine, \
unsigned int amount);
extern const struct health_component health_component;
#endif //MY_RPG_HEALTH_COMPONENT_H