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:
@@ -57,6 +57,9 @@ static bool level_setup(Level *level) {
|
||||
physics_set_gravity(DEFAULT_GRAVITY);
|
||||
}
|
||||
|
||||
/* Apply level wind (0 = no wind) */
|
||||
physics_set_wind(level->map.wind);
|
||||
|
||||
/* Apply level background color */
|
||||
if (level->map.has_bg_color) {
|
||||
renderer_set_clear_color(level->map.bg_color);
|
||||
|
||||
Reference in New Issue
Block a user