Jazz2::Actors::Environment::SwingingVine class

Swinging vine.

Vine that swings back and forth, which the player can grab onto and ride. While holding the vine the rabbit swings along with it and can let go to be flung across gaps that are too wide to jump.

Base classes

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

Public static variables

static std::int32_t DefaultLength constexpr
Length of a vine in JJ2, which has no parameter for it.

Public static functions

static void AdvanceSwing(std::int32_t& position, std::int32_t& speed)
Advances the swing by one tick of JJ2.
static auto GetLegacyTipOffset(std::int32_t length, std::int32_t position) -> Vector2f
Returns where the end of the vine is in JJ2 (xPos and yPos of the object), from its origin.
static void Preload(const ActorActivationDetails& details)
Preloads all assets required by this actor.

Constructors, destructors, conversion operators

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

Public functions

auto OnHandleCollision(ActorBase* other) -> bool override
Called when the object collides with another object.
void GetSwing(std::int32_t& length, std::int32_t& position, std::int32_t& speed) const
Returns the swing as BEHAVIOR::SWINGINGVINE of JJ2 has it.
void SetSwing(std::int32_t length, std::int32_t position, std::int32_t speed)
Sets the swing, see GetSwing(), it goes on from there.
auto GetReleaseSpeedX() const -> float
Returns the horizontal speed a player letting go of the vine is flung with.

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.

Function documentation

void Jazz2::Actors::Environment::SwingingVine::GetSwing(std::int32_t& length, std::int32_t& position, std::int32_t& speed) const

Returns the swing as BEHAVIOR::SWINGINGVINE of JJ2 has it.

length is var[1], position is var[2] (from length * 256 on the right to the negative of it on the left), speed is var[3].