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

@@ -87,4 +87,28 @@ typedef struct ForceFieldData {
void force_field_register(EntityManager *em);
Entity *force_field_spawn(EntityManager *em, Vec2 pos);
/* ═══════════════════════════════════════════════════
* ASTEROID — Falls from the sky, damages the player
* on contact, explodes on hitting the ground, then
* respawns at its original position after a delay.
* ═══════════════════════════════════════════════════ */
#define ASTEROID_WIDTH 14
#define ASTEROID_HEIGHT 14
#define ASTEROID_FALL_SPEED 120.0f /* base fall speed (px/s) */
#define ASTEROID_DAMAGE 1
#define ASTEROID_RESPAWN 3.0f /* seconds before respawning */
typedef struct AsteroidData {
Vec2 spawn_pos; /* original position (for reset)*/
float fall_speed; /* current fall velocity */
float respawn_timer; /* countdown while inactive */
bool falling; /* true = falling, false = wait */
float trail_timer; /* particle trail interval */
float start_delay; /* initial delay before first fall */
} AsteroidData;
void asteroid_register(EntityManager *em);
Entity *asteroid_spawn(EntityManager *em, Vec2 pos);
#endif /* JNR_HAZARDS_H */