Add per-level wind atmosphere property

WIND directive in .lvl files sets a constant horizontal force (px/s^2)
that pushes entities, projectiles, and particles. Positive is rightward.

Wind is applied as acceleration in physics_update() (halved on ground),
directly to projectile and particle velocities, and as a gentle position
drift on flyers. Entities with gravity_scale=0 (drones, spacecraft) are
unaffected. Levels default to no wind when the directive is absent.
This commit is contained in:
Thomas
2026-03-01 17:13:01 +00:00
parent cdba479ced
commit 6c4b076c68
11 changed files with 56 additions and 5 deletions

View File

@@ -50,6 +50,7 @@ typedef struct Tilemap {
char tileset_path[ASSET_PATH_MAX]; /* tileset file path */
Vec2 player_spawn;
float gravity; /* level gravity (px/s^2), 0 = use default */
float wind; /* horizontal wind force (px/s^2), +=right */
char music_path[ASSET_PATH_MAX]; /* level music file path */
SDL_Color bg_color; /* background clear color */
bool has_bg_color; /* true if BG_COLOR was set */