diff options
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; } |