Add moon surface intro level with asteroid hazards and unarmed mechanics

Introduce moon01.lvl as the starting level — a pure jump-and-run intro
with no gun and no enemies, just platforming over gaps and dodging falling
asteroids. The player picks up their gun upon transitioning to level01.

New features:
- Moon tileset and PARALLAX_STYLE_MOON with crater terrain backgrounds
- Asteroid entity (ENT_ASTEROID): falls from sky, damages on contact,
  explodes on ground with particles, respawns after delay
- PLAYER_UNARMED directive disables gun for the level
- Pit rescue mechanic: falling costs 1 HP and auto-dashes upward
- Gun powerup entity type for future armed-pickup levels
- Segment-based procedural level generator with themed rooms
- Extended editor with entity palette and improved tile cycling
- Web shell improvements for Emscripten builds
This commit is contained in:
Thomas
2026-03-01 09:20:49 +00:00
parent ea6e16358f
commit fac7085056
30 changed files with 2139 additions and 83 deletions

View File

@@ -71,6 +71,34 @@ bool tilemap_load(Tilemap *map, const char *path, SDL_Renderer *renderer) {
sscanf(line + 14, "%255s", map->parallax_near_path);
} else if (strncmp(line, "MUSIC ", 6) == 0) {
sscanf(line + 6, "%255s", map->music_path);
} else if (strncmp(line, "PARALLAX_STYLE ", 15) == 0) {
int style = 0;
if (sscanf(line + 15, "%d", &style) == 1) {
map->parallax_style = style;
}
} else if (strncmp(line, "PLAYER_UNARMED", 14) == 0) {
map->player_unarmed = true;
} else if (strncmp(line, "EXIT ", 5) == 0) {
if (map->exit_zone_count < MAX_EXIT_ZONES) {
ExitZone *ez = &map->exit_zones[map->exit_zone_count];
float tx, ty, tw, th;
char target[ASSET_PATH_MAX] = {0};
/* EXIT <tile_x> <tile_y> <tile_w> <tile_h> [target_path] */
int n = sscanf(line + 5, "%f %f %f %f %255s",
&tx, &ty, &tw, &th, target);
if (n >= 4) {
ez->x = tx * TILE_SIZE;
ez->y = ty * TILE_SIZE;
ez->w = tw * TILE_SIZE;
ez->h = th * TILE_SIZE;
if (n == 5) {
snprintf(ez->target, sizeof(ez->target), "%s", target);
} else {
ez->target[0] = '\0'; /* no target = victory */
}
map->exit_zone_count++;
}
}
} else if (strncmp(line, "ENTITY ", 7) == 0) {
if (map->entity_spawn_count < MAX_ENTITY_SPAWNS) {
EntitySpawn *es = &map->entity_spawns[map->entity_spawn_count];