Distance-based sound effects with stereo panning for explosions, impacts, and pickups. Spacecraft entity with full state machine (fly-in, land, take off, fly-out), engine/synth sound loops, thruster particles, and PNG spritesheet. Moon level intro defers player spawn until ship lands. Also untrack build/ objects that were committed by mistake.
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
#ifndef JNR_LEVEL_H
|
|
#define JNR_LEVEL_H
|
|
|
|
#include "engine/tilemap.h"
|
|
#include "engine/entity.h"
|
|
#include "engine/camera.h"
|
|
#include "engine/audio.h"
|
|
#include "engine/parallax.h"
|
|
|
|
typedef struct Level {
|
|
Tilemap map;
|
|
EntityManager entities;
|
|
Camera camera;
|
|
Parallax parallax;
|
|
Music music;
|
|
bool music_started;
|
|
|
|
/* ── Exit / transition state ─────────── */
|
|
bool exit_triggered; /* player entered an exit zone */
|
|
char exit_target[ASSET_PATH_MAX]; /* target level path */
|
|
|
|
/* ── Intro sequence state ────────────── */
|
|
bool has_intro_ship; /* level has a spacecraft intro */
|
|
bool player_spawned; /* player has been spawned */
|
|
} Level;
|
|
|
|
bool level_load(Level *level, const char *path);
|
|
bool level_load_generated(Level *level, Tilemap *gen_map);
|
|
void level_update(Level *level, float dt);
|
|
void level_render(Level *level, float interpolation);
|
|
void level_free(Level *level);
|
|
|
|
/* Returns true if the player has triggered a level exit.
|
|
* The target path is stored in level->exit_target. */
|
|
bool level_exit_triggered(const Level *level);
|
|
|
|
#endif /* JNR_LEVEL_H */
|