Jazz2::Actors::Weapons::BouncerShot class

Bouncer (shot).

Elastic projectile that ricochets off walls, floors and ceilings while affected by gravity, bouncing around until its lifetime expires or it has bounced too many times. The powered-up variant lives longer and gradually steers its horizontal speed toward a target velocity.

Base classes

class ShotBase
Base class of a shot from a player's weapon.

Constructors, destructors, conversion operators

BouncerShot()
Creates a new instance.

Public functions

void OnFire(const std::shared_ptr<ActorBase>& owner, Vector2f gunspotPos, Vector2f speed, float angle, bool isFacingLeft)
Called when the shot is fired.
auto GetWeaponType() -> WeaponType override
Returns weapon type.

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 OnEmitLights(SmallVectorImpl<LightEmitter>& lights) override
Called when emitting lights.
auto OnPerish(ActorBase* collider) -> bool override
Called when the object has no health left and should perish.
void OnHitWall(float timeMult) override
Called when the object hits a wall.
void OnHitFloor(float timeMult) override
Called when the object hits a floor.
void OnHitCeiling(float timeMult) override
Called when the object hits a ceiling.
void OnRicochet() override
Called on shot ricochet.