diff options
author | nathan <nathansmith@disroot.org> | 2025-07-27 10:46:59 +0000 |
---|---|---|
committer | nathan <nathansmith@disroot.org> | 2025-07-27 10:46:59 +0000 |
commit | 9b3bbf4ef7c26c1267e8ea99024d9d1acd7f1376 (patch) | |
tree | 0035940891d844047f693ab6137803f543025acb | |
parent | 49a0487a9c02a4bcd9da965400e393820ba6372f (diff) | |
download | FindThings-9b3bbf4ef7c26c1267e8ea99024d9d1acd7f1376.tar.gz FindThings-9b3bbf4ef7c26c1267e8ea99024d9d1acd7f1376.tar.bz2 FindThings-9b3bbf4ef7c26c1267e8ea99024d9d1acd7f1376.zip |
Flower
-rw-r--r-- | assets/flower.png | bin | 0 -> 2561 bytes | |||
-rw-r--r-- | src/assets.c | 3 | ||||
-rw-r--r-- | src/assets.h | 5 | ||||
-rw-r--r-- | src/entity.c | 7 | ||||
-rw-r--r-- | src/entity.h | 6 | ||||
-rw-r--r-- | src/world.c | 4 |
6 files changed, 18 insertions, 7 deletions
diff --git a/assets/flower.png b/assets/flower.png Binary files differnew file mode 100644 index 0000000..09685a6 --- /dev/null +++ b/assets/flower.png diff --git a/src/assets.c b/src/assets.c index 1a7113a..0434b5c 100644 --- a/src/assets.c +++ b/src/assets.c @@ -4,7 +4,8 @@ const char textureAssetPaths[TEXTURE_ASSET_COUNT][FT_NAMEMAX] = { "mint.png", "nickel.png", "tree.png", - "bush.png" + "bush.png", + "flower.png" }; void initAssets(Assets* assets) diff --git a/src/assets.h b/src/assets.h index f5ef97f..2a1ee66 100644 --- a/src/assets.h +++ b/src/assets.h @@ -3,7 +3,7 @@ #ifndef ASSETS_H #define ASSETS_H -#define TEXTURE_ASSET_COUNT 4 +#define TEXTURE_ASSET_COUNT 5 extern const char textureAssetPaths[TEXTURE_ASSET_COUNT][FT_NAMEMAX]; @@ -14,7 +14,8 @@ enum { MINT_TEXTURE, NICKEL_TEXTURE, TREE_TEXTURE, - BUSH_TEXTURE + BUSH_TEXTURE, + FLOWER_TEXTURE }; typedef struct { diff --git a/src/entity.c b/src/entity.c index de5f7f3..2ad7754 100644 --- a/src/entity.c +++ b/src/entity.c @@ -30,6 +30,9 @@ Entity createEntity(EntityId id, Vector3 position) case BUSH: entity.box = entityBoxFromScale(BUSH_SCALE, 174.0, 124.0); break; + case FLOWER: + entity.box = entityBoxFromScale(FLOWER_SCALE, 32.0, 54.0); + break; default: break; } @@ -59,6 +62,10 @@ void updateEntity(Entity* entity, Game* game) DrawBillboard(game->player.camera, game->assets.textures[BUSH_TEXTURE], entity->position, BUSH_SCALE, WHITE); break; + case FLOWER: + DrawBillboard(game->player.camera, game->assets.textures[FLOWER_TEXTURE], + entity->position, FLOWER_SCALE, WHITE); + break; default: break; } diff --git a/src/entity.h b/src/entity.h index 915c562..f647e14 100644 --- a/src/entity.h +++ b/src/entity.h @@ -7,18 +7,20 @@ typedef int8_t EntityId; -#define ENTITY_COUNT 4 +#define ENTITY_COUNT 5 // Entity scales. #define TREE_SCALE 32.0 #define BUSH_SCALE 6.0 +#define FLOWER_SCALE 2.0 enum { ENTITY_NONE = -1, OLD_MINT, STICKY_NICKEL, TREE, - BUSH + BUSH, + FLOWER }; typedef struct { diff --git a/src/world.c b/src/world.c index a576e24..6b8d60b 100644 --- a/src/world.c +++ b/src/world.c @@ -335,8 +335,8 @@ Seed generateWorldPlants(World* world, Seed seed) FT_RANDOM16(seed); // Get id for plant. - EntityId plants[] = {TREE, BUSH}; - size_t plantsSize = 2; + EntityId plants[] = {TREE, BUSH, FLOWER}; + size_t plantsSize = 3; EntityId id = plants[seed % plantsSize]; // Get position. |