aboutsummaryrefslogtreecommitdiff
path: root/src/entity.h
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-07-20 03:08:57 -0600
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-07-20 03:08:57 -0600
commit43e31b6e124da754ef928d22fbb9a1d7640aab4b (patch)
tree698f723866bd99982a6c606c63cfa0387863e2db /src/entity.h
parentf3f5fedbf591c10fa675a32103bab9480b42abe8 (diff)
New bullet system
Diffstat (limited to 'src/entity.h')
-rw-r--r--src/entity.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/entity.h b/src/entity.h
index dc6be72..844386c 100644
--- a/src/entity.h
+++ b/src/entity.h
@@ -45,11 +45,23 @@ typedef struct EntityVelocity {
EntityVelocity entityVelocityIdentity();
+// This fucker hit something.
+typedef struct EntityCollision {
+ bool hit;
+ EntityId fromId;
+ EntityFingerprint fromFingerprint;
+} EntityCollision;
+
+// Health stuff.
+#define ENTITY_MIN_HEALTH 0.0
+#define ENTITY_MAX_HEALTH 1.0
+
// This fucker is a entity.
typedef struct Entity {
EntityId id;
EntityFingerprint fingerprint;
EntityType type;
+
Model * model;
Vector3 position;
@@ -67,6 +79,8 @@ typedef struct Entity {
// Health is a percent from 1.0 to 0.0.
float health;
+ EntityCollision collision;
+
// Used for whatever.
void * data;
} Entity;
@@ -88,6 +102,8 @@ const extern EntityTypeInfo entityTypeInfo[ENTITY_TYPE_COUNT];
Entity createEntity(EntityType type, Game * game);
void closeEntity(Entity * entity);
+bool entitiesCollide(Entity entity1, Entity entity2);
+
// Helper functions for updating and drawing.
void entityDraw(Entity * entity);
void entityUpdatePosition(Entity * entity);