Shared simulation primitives and constants used by both the client and the authoritative server.
More...
|
| bool | isWalkable (const TileMap &map, int col, int row) |
| | Returns true if the given tile coordinate is passable.
|
| |
|
bool | overlapsWall (const TileMap &map, int32_t xQ, int32_t yQ) |
| | Returns true if the AABB centered at (xQ, yQ) with half-extent kHitboxHalfQ overlaps any solid tile.
|
| |
| TilePos | stepMovement (TilePos pos, int8_t moveX, int8_t moveY, int32_t speedQ=kPlayerSpeedQ) |
| | Advances a position by one simulation tick given a directional input.
|
| |
| TilePos | stepMovementWithCollision (TilePos pos, int8_t moveX, int8_t moveY, const TileMap &map, int32_t speedQ=kPlayerSpeedQ) |
| | Advances a position by one tick with tile-map collision.
|
| |
| int | tileQToScreen (int32_t tileQ, int fieldPx, int scaledTile, int cameraPx) |
| | Converts a center tile-Q8 coordinate to the screen pixel at that center.
|
| |
| int | tileQToScreenTopLeft (int32_t tileQ, int fieldPx, int scaledTile, int cameraPx) |
| | Converts a center tile-Q8 coordinate to the screen top-left pixel for sprite rendering.
|
| |
|
constexpr bool | isValidPowerupType (const uint8_t rawType) |
| | Returns true when a raw byte encodes one of the defined powerup types.
|
| |
|
constexpr std::string_view | powerupTypeName (const PowerupType type) |
| | Returns a human-readable name for one powerup type.
|
| |
|
constexpr std::size_t | powerupTypeIndex (const PowerupType type) |
| | Returns the stable array index used for per-type powerup stats.
|
| |
|
constexpr uint32_t | powerupEffectDurationTicks (const PowerupType type) |
| | Returns the configured lifetime for one powerup effect.
|
| |
|
constexpr SpawnSlotCell | spawnSlotCellForPlayerId (const uint8_t playerId) |
| | Returns the default spawn slot assigned to the given player id.
|
| |
|
constexpr TilePos | spawnSlotTilePos (const SpawnSlotCell slot) |
| | Converts one tile-cell spawn slot to a center-position tile-Q8 coordinate.
|
| |
|
constexpr TilePos | spawnTilePosForPlayerId (const uint8_t playerId) |
| | Returns the default center-position tile-Q8 spawn for the given player id.
|
| |
| void | generateTileMap (uint32_t seed, Tile outTiles[tileArrayHeight][tileArrayWidth]) |
| | Populates outTiles with a procedurally generated tile map.
|
| |
|
|
constexpr int32_t | kPlayerSpeedQ = static_cast<int32_t>(kPlayerSpeedTilesPerSecond * 256.0 / kTickRate + 0.5) |
| | Player movement speed in tile-Q8 units per simulation tick.
|
| |
|
constexpr int32_t | kHitboxHalfQ = static_cast<int32_t>(kPlayerHitboxScale * 256.0f / 2.0f) |
| | Player hitbox half-extent in tile-Q8 units.
|
| |
|
constexpr std::size_t | kPowerupTypeCount = 4 |
| | Number of defined multiplayer powerup types.
|
| |
| constexpr std::array< PowerupType, 4 > | kRoundPowerupPlacements |
| | Stable per-round hidden placements seeded under random bricks.
|
| |
|
constexpr uint8_t | kPowerupsPerRound = static_cast<uint8_t>(kRoundPowerupPlacements.size()) |
| | Number of hidden powerups seeded into each round when enabled.
|
| |
|
constexpr uint32_t | kDefaultPowerupDurationTicks = static_cast<uint32_t>(kTickRate) * 10u |
| | Default temporary powerup lifetime in simulation ticks.
|
| |
|
constexpr uint32_t | kInvincibilityDurationTicks = kDefaultPowerupDurationTicks |
| | Invincibility lifetime in simulation ticks.
|
| |
|
constexpr uint32_t | kSpeedBoostDurationTicks = kDefaultPowerupDurationTicks |
| | Speed boost lifetime in simulation ticks.
|
| |
|
constexpr uint32_t | kBombRangeBoostDurationTicks = kDefaultPowerupDurationTicks |
| | Bomb-range boost lifetime in simulation ticks.
|
| |
|
constexpr uint32_t | kMaxBombsBoostDurationTicks = kDefaultPowerupDurationTicks |
| | Max-bombs boost lifetime in simulation ticks.
|
| |
|
constexpr double | kSpeedBoostTilesPerSecond = 5.5 |
| | Future movement-speed target while the speed boost is active.
|
| |
| constexpr int32_t | kSpeedBoostPlayerSpeedQ |
| | Movement speed in tile-Q8 units per simulation tick while the speed boost is active.
|
| |
|
constexpr uint8_t | kBombRangeBoostAmount = 1 |
| | Additional blast radius applied to bombs placed during the range boost.
|
| |
|
constexpr uint8_t | kBoostedMaxBombs = 2 |
| | Bomb-cap target while the max-bombs boost is active.
|
| |
|
constexpr uint32_t | kPowerupPlacementSeedSalt = 0x9E3779B9u |
| | Deterministic salt mixed into round placement RNG so repeated map seeds can still vary by round.
|
| |
|
constexpr int16_t | kTickRate = 60 |
| | Simulation tick rate in Hz.
|
| |
|
constexpr uint8_t | kDefaultPlayerMaxBombs = 1 |
| | Default number of simultaneously active bombs a player may own.
|
| |
|
constexpr uint8_t | kDefaultPlayerBombRange = 1 |
| | Default explosion radius in tiles for newly placed bombs.
|
| |
|
constexpr uint32_t | kDefaultBombFuseTicks = static_cast<uint32_t>(kTickRate) * 3u / 2u |
| | Default authoritative bomb fuse in simulation ticks.
|
| |
|
constexpr double | kPlayerSpeedTilesPerSecond = 4.0 |
| | Player movement speed in tiles per second.
|
| |
| constexpr float | kPlayerHitboxScale = 0.5f |
| | Player hitbox size as a fraction of the tile size.
|
| |
|
constexpr int32_t | kMaxFrameClampMs = 250 |
| | Maximum milliseconds the fixed-step accumulator will simulate in one frame.
|
| |
|
constexpr int32_t | kMaxStepsPerFrame = 8 |
| | Maximum simulation steps taken within a single frame even if the accumulator exceeds the limit.
|
| |
|
constexpr int32_t | kDefaultServerInputLeadTicks = 1 |
| | Default server-side input lead in ticks for authoritative input scheduling.
|
| |
|
constexpr int32_t | kDefaultServerSnapshotIntervalTicks = 1 |
| | Default server snapshot interval in simulation ticks (1 = every tick / 60 Hz).
|
| |
|
constexpr uint8_t | kLeftSpawnCol = 1 |
| |
|
constexpr uint8_t | kRightSpawnCol = static_cast<uint8_t>(tileArrayWidth - 2) |
| |
|
constexpr uint8_t | kTopSpawnRow = 1 |
| |
|
constexpr uint8_t | kBottomSpawnRow = 9 |
| |
| constexpr std::array< SpawnSlotCell, 4 > | kDefaultSpawnSlots |
| | Default player-id keyed spawn slots for the current arena layout.
|
| |
Shared simulation primitives and constants used by both the client and the authoritative server.