Skip to Content
The Alchemy Project

src/scene/shared/actor_vent_bounce.c

The drift of a puff of mist a vent blows out, which Aqua Rock's inside and Taopo Swamp each include a copy of. More…

Included by aqua_rock_inside.c and taopo_swamp.c.

Functions

NameDescription
BoolVentIsTouching (ACTOR *a, ACTOR *b)Whether puff a has reached actor b: within 12 pixels of it in x and 8 in z, and above its feet by less than 16 pixels.
voidscVentBounce (ACTOR *actor)Moves a puff by its velocities, slows it in x and z, grows and spins its sprite, and stops its drift in z when it reaches the leader, or one of the actors the vent state lists, standing on the ground.

Description

The drift of a puff of mist a vent blows out, which Aqua Rock's inside and Taopo Swamp each include a copy of. scene/scene.h, which the including scene reads first, gives it VENT_WORK, VENT_STATE and DIFF.

Functions in detail

VentIsTouching

Bool VentIsTouching(ACTOR *a, ACTOR *b)

Whether puff a has reached actor b: within 12 pixels of it in x and 8 in z, and above its feet by less than 16 pixels.

Referenced by scVentBounce().

Definition at line 7 of file actor_vent_bounce.c.

scVentBounce

void scVentBounce(ACTOR *actor)

Moves a puff by its velocities, slows it in x and z, grows and spins its sprite, and stops its drift in z when it reaches the leader, or one of the actors the vent state lists, standing on the ground. scVentPuff keeps the puff's motion in fields it borrows for the purpose: bounce is its x velocity, gravity its y velocity and sceneWord its z velocity, all 16.16 pixels a tick; speedLimit and acceleration are what its x and y scale grow by each tick, and spin turns it.

References fdActorGetById(), MainRoutineStateWork, Sint32 and VentIsTouching().

Referenced by scVentPuff().

Definition at line 27 of file actor_vent_bounce.c.