From 8874e4a585d66c16299ad45e79ea6c55960dee02 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 24 Oct 2025 04:24:35 -0600 Subject: Working on interaction system (finally) --- src/entity.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/entity.c') diff --git a/src/entity.c b/src/entity.c index 919da95..70a7db5 100644 --- a/src/entity.c +++ b/src/entity.c @@ -16,6 +16,7 @@ Entity createEntity(EntityId id, Vector3 position) { Entity entity; entity.id = id; + entity.state = ENTITY_DEFAULT_STATE; // Bounding boxes. switch (id) @@ -213,3 +214,32 @@ void placeEntityOnGround(Entity* entity, const World* world) setEntityPosition(entity, position); } + + +InteractionCommand interactWithOldMint(Entity* entity, Game* game, + Selection selection) +{ + if (selection == SELECTION_INTERACT) + { + // Run display message code. + return INTERACTION_TALK; + } + else + { + return INTERACTION_END; + } +} + +InteractionCommand interactWithEntity(Entity* entity, Game* game, + Selection selection) +{ + switch (entity->id) + { + case OLD_MINT: // For testing. + return interactWithOldMint(entity, game, selection); + default: + break; + } + + return INTERACTION_END; +} -- cgit v1.2.3