Jazz2::Actors::Solid::Bridge class

Bridge.

A span the player can walk across that sags downward under their weight and springs back once they step off, made up of individually drawn pieces. Several visual styles exist (rope, vine, stone, log, etc.) depending on the level theme.

Base classes

class Jazz2::Actors::ActorBase
Base class of an object.

Public static functions

static void Preload(const ActorActivationDetails& details)
Preloads all assets required by this actor.
static void GetPieceOffsets(std::uint8_t bridgeType, std::int32_t bridgeWidth, const GraphicResource* resource, SmallVectorImpl<std::int32_t>& offsets)
Appends where the pieces of a bridge are, from the position of the bridge.

Constructors, destructors, conversion operators

Bridge()
Creates a new instance.
~Bridge()

Protected functions

auto OnActivatedAsync(const ActorActivationDetails& details) -> Task<bool> override
Called when the object is created and activated.
void OnUpdate(float timeMult) override
Called every frame to update the object state.
void OnUpdateHitbox() override
Called when the hitbox needs to be updated.
auto OnDraw(RenderQueue& renderQueue) -> bool override
Called when the object needs to be drawn.
void OnPacketReceived(MemoryStream& packet) override
Applies authoritative sag state received from the server (clients only, in multiplayer).

Function documentation

static void Jazz2::Actors::Solid::Bridge::GetPieceOffsets(std::uint8_t bridgeType, std::int32_t bridgeWidth, const GraphicResource* resource, SmallVectorImpl<std::int32_t>& offsets)

Appends where the pieces of a bridge are, from the position of the bridge.

bridgeType and bridgeWidth (in pixels) are as the event gives them, resource is the animation of the pieces, they're as wide as its frames. The level editor shows a bridge this way, piece by piece, as long as it is.