Jazz2::Actors::Bosses::Robot class

Robot (boss).

A giant robot, piloted by Devan in his remote-control battle. It descends by helicopter rotor, then runs back and forth chasing the player and firing bouncing spike balls in bursts. It is defeated by depleting its health, shedding sprite debris as it takes damage.

Base classes

class Jazz2::Actors::Enemies::EnemyBase
Base class of an enemy.

Public static functions

static void Preload(const ActorActivationDetails& details)
Preloads all assets required by this actor.

Constructors, destructors, conversion operators

Robot()
Creates a new instance.

Public functions

void Activate()
Activates the boss, making it visible and starting its fight.
void Deactivate()
Deactivates the boss, hiding it and returning it to the waiting state.

Protected functions

auto IsSerializable() const -> bool override
Returns true if the live state of the object can be stored in a level state snapshot.
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 OnHealthChanged(ActorBase* collider) override
Called when health of the object changed.
auto OnPerish(ActorBase* collider) -> bool override
Called when the object has no health left and should perish.

Function documentation

bool Jazz2::Actors::Bosses::Robot::IsSerializable() const override protected

Returns true if the live state of the object can be stored in a level state snapshot.

A snapshot stores the event type and parameters the object was spawned with together with its live state, so the object can be spawned again and resurrected exactly as it was. That works only for objects spawned from an event (see ActorActivationDetails::Type) which is registered in Events::EventSpawner. Objects that are not worth restoring (e.g., short-lived effects) can opt out by overriding it.