Add jetpack fuel pickup and slow base recharge to 30s

Jetpack charges now take 30s to passively recharge (up from 3s),
making fuel management a core gameplay loop. A new fuel canister
powerup (POWERUP_FUEL) restores exactly one charge on pickup.

The existing jetpack powerup remains as the rare full-refill + 15s
boost. Fuel pickups replace most procedural jetpack spawns at higher
spawn rates to compensate for the weaker per-pickup value. Fuel
canisters also appear in corridors and arenas.

Adds orange canister pixel art, editor icon, entity registry entry,
and places fuel pickups throughout moon01.
This commit is contained in:
Thomas
2026-03-01 18:06:32 +00:00
parent fdba6ef077
commit bb0b9ddce1
11 changed files with 135 additions and 27 deletions

View File

@@ -328,6 +328,24 @@ static void handle_collisions(EntityManager *em) {
break;
}
case POWERUP_FUEL: {
PlayerData *ppd = (PlayerData *)player->data;
if (ppd && ppd->dash_charges < ppd->dash_max_charges) {
ppd->dash_charges++;
/* Reset recharge timer for the next charge */
if (ppd->dash_charges < ppd->dash_max_charges) {
float rate = (ppd->jetpack_boost_timer > 0)
? PLAYER_JETPACK_BOOST_RECHARGE
: PLAYER_DASH_RECHARGE;
ppd->dash_recharge_timer = rate;
} else {
ppd->dash_recharge_timer = 0.0f;
}
picked_up = true;
}
break;
}
case POWERUP_DRONE:
drone_spawn(em, vec2(
player->body.pos.x + player->body.size.x * 0.5f,