From 43e31b6e124da754ef928d22fbb9a1d7640aab4b Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Thu, 20 Jul 2023 03:08:57 -0600 Subject: New bullet system --- src/entity.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/entity.h') 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); -- cgit v1.2.3