From c65787ebfc5f0701bb4366ef22cddc8af2d243ee Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 25 Jul 2025 01:57:49 -0600 Subject: More tree things --- src/entity.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'src/entity.c') diff --git a/src/entity.c b/src/entity.c index d5a0bab..25136c2 100644 --- a/src/entity.c +++ b/src/entity.c @@ -7,13 +7,32 @@ Entity createEntity(EntityId id, Vector3 position) Entity entity; entity.id = id; - // Test box. - float boxSize = 0.4; - entity.box.min = (Vector3){-boxSize, -boxSize, -boxSize}; - entity.box.max = (Vector3){boxSize, boxSize, boxSize}; + switch (id) + { + case OLD_MINT: + case STICKY_NICKEL: + entity.box = (BoundingBox){ + .min = (Vector3){-0.4, -0.4, -0.4}, + .max = (Vector3){0.4, 0.4, 0.4} + }; + + break; + case TREE: + + { + Vector2 size = (Vector2){225.0 / 500.0 * TREE_SCALE, TREE_SCALE}; + size = Vector2Scale(size, 0.5); + + entity.box = (BoundingBox){ + .min = (Vector3){-size.x, -size.y, -size.x}, + .max = (Vector3){size.x, size.y, size.x} + }; + } + + break; + } setEntityPosition(&entity, position); - return entity; } @@ -29,6 +48,10 @@ void updateEntity(Entity* entity, Game* game) DrawBillboard(game->player.camera, game->assets.textures[NICKEL_TEXTURE], entity->position, 1.0, WHITE); break; + case TREE: + DrawBillboard(game->player.camera, game->assets.textures[TREE_TEXTURE], + entity->position, TREE_SCALE, WHITE); + break; default: break; } -- cgit v1.2.3