forked from tas/major_tom
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:
@@ -1631,6 +1631,10 @@ bool levelgen_dump_lvl(const Tilemap *map, const char *path) {
|
||||
fprintf(f, "GRAVITY %.0f\n", map->gravity);
|
||||
}
|
||||
|
||||
if (map->wind != 0.0f) {
|
||||
fprintf(f, "WIND %.0f\n", map->wind);
|
||||
}
|
||||
|
||||
if (map->has_bg_color) {
|
||||
fprintf(f, "BG_COLOR %d %d %d\n",
|
||||
map->bg_color.r, map->bg_color.g, map->bg_color.b);
|
||||
|
||||
Reference in New Issue
Block a user