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

@@ -31,6 +31,10 @@ static Entity *spawn_powerup_drone(EntityManager *em, Vec2 pos) {
return powerup_spawn_drone(em, pos);
}
static Entity *spawn_powerup_gun(EntityManager *em, Vec2 pos) {
return powerup_spawn_gun(em, pos);
}
/* ── Registry population ─────────────────────────── */
static void reg_add(const char *name, const char *display,
@@ -62,6 +66,7 @@ void entity_registry_init(EntityManager *em) {
force_field_register(em);
powerup_register(em);
drone_register(em);
asteroid_register(em);
/* ════════════════════════════════════════════
* REGISTRY TABLE
@@ -85,6 +90,8 @@ void entity_registry_init(EntityManager *em) {
reg_add("powerup_hp", "Health Pickup", spawn_powerup_health, (SDL_Color){255, 80, 80, 255}, 12, 12);
reg_add("powerup_jet", "Jetpack Refill", spawn_powerup_jetpack,(SDL_Color){255, 200, 50, 255}, 12, 12);
reg_add("powerup_drone", "Drone Pickup", spawn_powerup_drone, (SDL_Color){80, 200, 255, 255}, 12, 12);
reg_add("powerup_gun", "Gun Pickup", spawn_powerup_gun, (SDL_Color){200, 200, 220, 255}, 12, 12);
reg_add("asteroid", "Asteroid", asteroid_spawn, (SDL_Color){140, 110, 80, 255}, ASTEROID_WIDTH, ASTEROID_HEIGHT);
printf("Entity registry: %d types registered\n", g_entity_registry.count);
}