From f11daf2fdc3f3e090efbbc6beec8d3af831e8280 Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 11 Oct 2025 05:03:05 -0600 Subject: More john and ron are correct size now --- src/entity.c | 15 ++++++--------- src/entity.h | 10 +++++++--- src/player.h | 2 +- src/world.c | 14 ++++++++++---- src/world.h | 2 +- 5 files changed, 25 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/entity.c b/src/entity.c index 0c0b914..018b450 100644 --- a/src/entity.c +++ b/src/entity.c @@ -78,16 +78,13 @@ Entity createEntity(EntityId id, Vector3 position) break; // TODO: do the thing case JOHN: + case RON: // John and Ron ARE NOT the same person. entity.box = (BoundingBox){ - .min = (Vector3){-1.0, -1.0, -1.0}, - .max = (Vector3){1.0, 1.0, 1.0} - }; - - break; - case RON: - entity.box = (BoundingBox){ - .min = (Vector3){-1.0, -1.0, -1.0}, - .max = (Vector3){1.0, 1.0, 1.0} + .min = (Vector3){-SHOPKEEPER_WIDTH, -SHOPKEEPER_HEIGHT, + -SHOPKEEPER_THICKNESS}, + .max = (Vector3){SHOPKEEPER_WIDTH, SHOPKEEPER_HEIGHT, + SHOPKEEPER_THICKNESS} + }; break; diff --git a/src/entity.h b/src/entity.h index a83a5d0..9c842d3 100644 --- a/src/entity.h +++ b/src/entity.h @@ -17,9 +17,9 @@ #define UTILITY_POLE_HEIGHT 100.0 #define UTILITY_POLE_RADIUS 3.0 -#define SAMANTHA_WIDTH 2.65966 / 2.0 -#define SAMANTHA_HEIGHT 3.21054 / 2.0 -#define SAMANTHA_THICKNESS 1.46845 / 2.0 +#define SAMANTHA_WIDTH (2.65966 / 2.0) +#define SAMANTHA_HEIGHT (3.21054 / 2.0) +#define SAMANTHA_THICKNESS (1.46845 / 2.0) #define SAMANTHA_STATIC_SPEED 24 #define SAMANTHA_STATIC_FRAMES 4 @@ -36,6 +36,10 @@ #define MEDICAL_TRASH_SCALE 2.0 +#define SHOPKEEPER_WIDTH (2.04211 / 2.0) +#define SHOPKEEPER_HEIGHT (2.59521 / 2.0) +#define SHOPKEEPER_THICKNESS (0.493349 / 2.0) + typedef int8_t EntityId; enum { diff --git a/src/player.h b/src/player.h index 9bc049f..d66b9dd 100644 --- a/src/player.h +++ b/src/player.h @@ -4,7 +4,7 @@ #define PLAYER_H #define PLAYER_HEIGHT 2.0 -#define PLAYER_SPEED 10.0 +#define PLAYER_SPEED 8.0 typedef struct { Vector3 position; diff --git a/src/world.c b/src/world.c index b6fb9dc..42e3488 100644 --- a/src/world.c +++ b/src/world.c @@ -716,8 +716,14 @@ Texture generateGroundTexture() return texture; } -Seed generateWorldCharacters(World* world, Seed seed, int index) +Seed generateWorldCharacters(World* world, Seed seed, WorldUID start) { + WorldUID index = start; + + Entity ron = createEntity(RON, Vector3Scale(world->size, 0.5)); + placeEntityOnGround(&ron, world); + world->entities[index] = ron; + return seed; } @@ -779,9 +785,9 @@ World createWorld(Seed seed, const Assets* assets) seed = generateWorldUtilityPoles(&world, assets, seed, start, end); // Characters. - /* start = end; */ - /* end = WORLD_CHARACTER_COUNT + start; */ - /* seed = generateWorldCharacters(&world, seed, start); */ + start = end; + end = WORLD_CHARACTER_COUNT + start; + seed = generateWorldCharacters(&world, seed, start); // Items. start = end; diff --git a/src/world.h b/src/world.h index 456d68a..93bcb38 100644 --- a/src/world.h +++ b/src/world.h @@ -32,7 +32,7 @@ #define PLACE_POND_WALKING_AREA 7 // Characters. -#define WORLD_CHARACTER_COUNT 0 +#define WORLD_CHARACTER_COUNT 1 #define SAMANTHA_OFFSET (Vector3){0.0, 0.0, 2.0} #define SAMANTHAS_SPOT_TRASHCAN_COUNT 5 -- cgit v1.2.3