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

@@ -30,6 +30,14 @@ typedef struct EntitySpawn {
float x, y; /* world position (pixels) */
} EntitySpawn;
/* Exit zone — triggers level transition on player overlap */
typedef struct ExitZone {
float x, y, w, h; /* world-space bounding box */
char target[ASSET_PATH_MAX]; /* path to next level, or
* "generate" for procgen,
* or empty for "you win" */
} ExitZone;
typedef struct Tilemap {
int width, height; /* map size in tiles */
uint16_t *bg_layer; /* background tile IDs */
@@ -47,8 +55,11 @@ typedef struct Tilemap {
char parallax_far_path[ASSET_PATH_MAX]; /* far bg image path */
char parallax_near_path[ASSET_PATH_MAX]; /* near bg image path */
int parallax_style; /* procedural bg style (0=default) */
bool player_unarmed; /* if true, player starts without gun */
EntitySpawn entity_spawns[MAX_ENTITY_SPAWNS];
int entity_spawn_count;
ExitZone exit_zones[MAX_EXIT_ZONES];
int exit_zone_count;
} Tilemap;
bool tilemap_load(Tilemap *map, const char *path, SDL_Renderer *renderer);