Controls

🔍
Needs Verification
The exact key bindings are derived from code analysis. The original game likely supported configuration via 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.

ConstantValueDescription
KEY_NONE0No key pressed
KEY_LEFT1Move left
KEY_RIGHT2Move right
KEY_UP4Look/move up
KEY_DOWN8Look/move down
KEY_JUMP16Jump
KEY_FIRE32Fire / action (tank fire, place bomb)

Basic Controls

ActionKeysNotes
Move leftLeft Arrow
Move rightRight Arrow
JumpSpace / Up ArrowDifferent jump heights possible
Look upUp Arrow (while still)ACTION_UP
Look downDown Arrow (while still)ACTION_DOWN
Fire / ActionCtrl / Fire buttonUsed for tank fire, placing bombs

Vehicle Controls

When Blupi is in a vehicle, the same keys control vehicle movement:

VehicleMovementSpecial Action
HelicopterArrow keys (fly)Fire button — exit helicopter
JeepLeft/Right (drive)
TankLeft/Right (drive)Fire — shoot bullet
HovercraftLeft/Right (move)Flies at fixed height
SkateboardLeft/Right (skate)Jump — jump while skating

Interaction Controls

ActionKeysNotes
Push crateWalk into crateACTION_PUSH
Pull crateWalk while facing crateACTION_POP
Grab bar (hang)Jump into bars overheadACTION_STOPSUSPEND
Move on barsLeft/Right while hangingACTION_MARCHSUSPEND
Pull up from barsUp Arrow while hangingACTION_JUMPSUSPEND
Place dynamiteFire 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.