CollectibleBase class
Base class of a collectible object.
Base for pickups that grant the player a bonus when collected on contact. It provides the behavior shared by all collectibles: the floating/bobbing animation, optional light emission when illuminated, and dispatching the collection logic to the deriving type.
Base classes
- class Jazz2::Actors::ActorBase
- Base class of an object.
Derived classes
- class AmmoCollectible
- Ammo (collectible).
- class CarrotCollectible
- Carrot (collectible).
- class CarrotFlyCollectible
- Fly carrot (collectible).
- class CarrotInvincibleCollectible
- Invincible carrot (collectible).
- class CoinCollectible
- Coin (collectible).
- class FastFireCollectible
- Fast fire (collectible).
- class FoodCollectible
- Food (collectible).
- class GemCollectible
- Gem (collectible).
- class GemRing
- Gem ring.
- class OneUpCollectible
- 1up (collectible)
- class Stopwatch
- Stopwatch.
Constructors, destructors, conversion operators
- CollectibleBase()
- Creates a new instance.
Public functions
- auto OnHandleCollision(ActorBase* other) -> bool override
- Called when the object collides with another object.
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.
- void OnCollect(Player* player) virtual
- Called when the collectible is collected.
- void SetFacingDirection(bool inverse = false)
- Sets facing direction.
Constants
-
static std::
int32_t IlluminateLightCount protected constexpr - Number of lights emitted when the collectible is illuminated.