summaryrefslogtreecommitdiff
path: root/inc/entity.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/entity.h')
-rw-r--r--inc/entity.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/inc/entity.h b/inc/entity.h
index 40c2bce..ee8b935 100644
--- a/inc/entity.h
+++ b/inc/entity.h
@@ -3,6 +3,10 @@
enum { MAX_GROUP_WORDS = 8 };
enum { EVENT_INIT, EVENT_JUMP, EVENT_DOUBLEJUMP, EVENT_DEATH, EVENT_LASTKEY };
+typedef struct EntityColor {
+ f32 r, g, b;
+} EntityColor;
+
typedef struct Entity {
ETable *table;
u64 uuid;
@@ -42,9 +46,9 @@ typedef struct Entity {
bool do_x;
bool do_y;
u8 color_group;
- struct {
- u8 r, g, b, a;
- } color;
+ u32 fade_in;
+ EntityColor initial_color;
+ EntityColor color;
} Entity;
vec_decl(EntityP, Entity *);
@@ -65,6 +69,7 @@ i32 entity_propertyi(Entity *, const char *property);
i32 entity_propertyi_default(Entity *, const char *property, i32 def);
i32 entity_propertyo(Entity *, const char *property);
i32 entity_propertyo_default(Entity *, const char *property, i32 def);
+f32 entity_propertyf(Entity *, const char *property, f32 def);
bool entity_propertyb(Entity *, const char *property);
const char *entity_propertyc(Entity *, const char *property);
void entity_append_group(Entity *, u32 gid);
@@ -86,6 +91,7 @@ bool entity_in_group(Entity *, u32 gid);
#define propertyi_default(X, V) entity_propertyi_default(this, (X), (V))
#define propertyo(X) entity_propertyo(this, (X))
#define propertyo_default(X, V) entity_propertyo_default(this, (X), (V))
+#define propertyf(X, V) entity_propertyf(this, (X), (V))
#define propertyb(X) entity_propertyb(this, (X))
#define propertyc(X) entity_propertyc(this, (X))
#define draw_hitbox(...) \