diff options
author | nathan <nathansmith@disroot.org> | 2025-07-25 07:57:49 +0000 |
---|---|---|
committer | nathan <nathansmith@disroot.org> | 2025-07-25 07:57:49 +0000 |
commit | c65787ebfc5f0701bb4366ef22cddc8af2d243ee (patch) | |
tree | 4de559bb7a77994c6e39adffb95edeeeb3d3a07a /src/entity.c | |
parent | f96ad3c93b9a5a74d2af2e9b8b4835a672a9875b (diff) | |
download | FindThings-c65787ebfc5f0701bb4366ef22cddc8af2d243ee.tar.gz FindThings-c65787ebfc5f0701bb4366ef22cddc8af2d243ee.tar.bz2 FindThings-c65787ebfc5f0701bb4366ef22cddc8af2d243ee.zip |
More tree things
Diffstat (limited to 'src/entity.c')
-rw-r--r-- | src/entity.c | 33 |
1 files changed, 28 insertions, 5 deletions
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; } |