Controls
gamefiles/DATA/config.def.
Some controls may not yet work correctly in the current build.
Keyboard Input Flags
Input is tracked as a bitmask of pressed keys in include/def.hpp.
These constants are used throughout src/event.cpp and
src/decblupi.cpp.
| Constant | Value | Description |
|---|---|---|
KEY_NONE | 0 | No key pressed |
KEY_LEFT | 1 | Move left |
KEY_RIGHT | 2 | Move right |
KEY_UP | 4 | Look/move up |
KEY_DOWN | 8 | Look/move down |
KEY_JUMP | 16 | Jump |
KEY_FIRE | 32 | Fire / action (tank fire, place bomb) |
Basic Controls
| Action | Keys | Notes |
|---|---|---|
| Move left | Left Arrow | |
| Move right | Right Arrow | |
| Jump | Space / Up Arrow | Different jump heights possible |
| Look up | Up Arrow (while still) | ACTION_UP |
| Look down | Down Arrow (while still) | ACTION_DOWN |
| Fire / Action | Ctrl / Fire button | Used for tank fire, placing bombs |
Vehicle Controls
When Blupi is in a vehicle, the same keys control vehicle movement:
| Vehicle | Movement | Special Action |
|---|---|---|
| Helicopter | Arrow keys (fly) | Fire button — exit helicopter |
| Jeep | Left/Right (drive) | — |
| Tank | Left/Right (drive) | Fire — shoot bullet |
| Hovercraft | Left/Right (move) | Flies at fixed height |
| Skateboard | Left/Right (skate) | Jump — jump while skating |
Interaction Controls
| Action | Keys | Notes |
|---|---|---|
| Push crate | Walk into crate | ACTION_PUSH |
| Pull crate | Walk while facing crate | ACTION_POP |
| Grab bar (hang) | Jump into bars overhead | ACTION_STOPSUSPEND |
| Move on bars | Left/Right while hanging | ACTION_MARCHSUSPEND |
| Pull up from bars | Up Arrow while hanging | ACTION_JUMPSUSPEND |
| Place dynamite | Fire button (if carrying) | ACTION_PUTDYNAMITE |
Control Inversion
Some level hazards invert the player's controls.
When active, blupiInvert=TRUE in the game state and
left/right inputs are swapped. The inversion triggers game objects
of type TYPE_INVERT, TYPE_INVERTSTART, and
TYPE_INVERTSTOP.
Input Implementation
Input is processed in src/event.cpp by the CEvent class.
Key state is stored as a bitmask and fed to CDecor::SetInput(int keys)
each game tick. Player movement logic then reads from this in src/decblupi.cpp.
On the Emscripten (Web) build, keyboard events are translated to the same bitmask format. On Android, touch coordinates are mapped through SDL3's logical presentation layer to game coordinates.