map-level symbols
Each symbol becomes a typed runtime pickup in app->bonus.pickups.
Pickups add bonus gameplay progression by modifying player stats at runtime. They connect map symbols, runtime pickup entities, stat effects, sprite visibility, and HUD feedback.
Pickups and stats
Pickup symbols are discovered from the bonus map, stored as runtime entities, consumed by proximity checks, then reflected by sprites and HUD panels without rewriting the static map.
map-level symbols
Each symbol becomes a typed runtime pickup in app->bonus.pickups.
runtime storage Gameplay state is separate from static map text.
typedef struct s_pickup
{
double x;
double y;
int type;
int collected;
} t_pickup; pickups_update() Executed once per frame before render layers consume the state.
effect model Stat gains are type-driven and bounded by bonus constants.
hp = min(hp + HP_GAIN, HP_MAX);
armor = min(armor + ARMOR_GAIN, ARMOR_MAX);
ammo = min(ammo + AMMO_GAIN, AMMO_MAX);
score = min(score + SCORE_GAIN, SCORE_MAX);
// damage policy
armor absorbs first, remaining damage hits hp interactive stat simulation Collect pickups, apply damage, and observe clamping + collected state.
Collect a pickup to apply its stat effect.
post-update guarantees After the pickup update step, every consumer sees coherent state.
Pickups are represented by bonus sprite/tile markers in map content:
* for health@ for ammo) for armor/ for scoreDuring initialization, these symbols are discovered and stored in
app->bonus.pickups through bonus_pickups_rebuild(...), separate from static map text. Each runtime pickup stores
its world position, type, and collected flag.
Every frame, the pickup update path checks active pickups against the player position. If the player is inside pickup radius, the typed effect is applied, the pickup is marked collected, and the sprite layer is rebuilt only when the active pickup set actually changes.
Bonus stats are stored in app->bonus.stats:
hparmorammoscoreStat gains and maximum values are controlled by bonus constants. Health, armor, and ammo are clamped to their configured maxima. Damage handling consumes armor first, then applies any remaining damage to health.
Pickups integrate with:
After the pickup update step:
map.grid remains unchangedsrcs_bonus/pickups/pickups_api.csrcs_bonus/pickups/pickups_update.csrcs_bonus/pickups/pickups_effects.csrcs_bonus/pickups/pickups_sprites.csrcs_bonus/hud/hud_status.cinclude/structs_bonus.hinclude/defines_bonus.h