Skip to main content

Module game

Module game 

Source
Expand description

Top-level game state for one level: world, player, weapons, actors and triggers.

Modules§

ai 🔒
Enemy behaviour: perception (sight, hearing, editor flags), movement (chase, flee, strafe, obstacle and ledge avoidance) and special states (rising zombies, stone gargoyles, burning dudes). OpenBlood’s own design, tuned to feel like the original.
save
Saved games: the complete mutable game state serialized with bincode. Static data (tiles, animations, sounds) is reloaded from the original files.

Structs§

Game

Enums§

Ai
GameEvent
Events surfaced to the front end (sounds, messages, level changes).

Constants§

AIR_SECONDS
Breath before drowning starts.
EXPLODER 🔒
PLAYER_ID
Pseudo sprite id used for the player in traces.
PROJ_BASE 🔒
Projectile sprite types (OpenBlood-internal, outside Blood’s editor ranges).
TICK_RATE
Game clock rate.
TNT_BARREL 🔒
Thing types with special handling.
USE_RANGE
Reach of the “use” action in xy units.
WALL_CRACK 🔒

Functions§

is_marker_type
Sprite types that are editor-only markers.
lerp3 🔒
Blends a toward b; big jumps (teleports, respawns) are not blended.
sprite_extents
Vertical extents of a sprite as drawn: (top z, bottom z).