Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Functions
piranha_bubbles.inc.c File Reference

Functions

void bhv_piranha_plant_waking_bubbles_loop (void)
 Behavior for bhvPiranhaPlantBubble and bhvPiranhaPlantWakingBubbles. More...
 
void bhv_piranha_plant_bubble_loop (void)
 Main loop for bhvPiranhaPlantBubble. More...
 

Function Documentation

◆ bhv_piranha_plant_bubble_loop()

void bhv_piranha_plant_bubble_loop ( void  )

Main loop for bhvPiranhaPlantBubble.

After it is initialized, the bubble will grow and shrink continuously while the Piranha Plant sleeps. If the Piranha Plant ever stops sleeping, the bubble will disappear and spawn many bubbles to appear to burst. After bursting, the bubble is reinitialized and the cycle can repeat.

Set the frame after shrinking is done to be slightly before halfway through the animation, and the frame before growing slightly after halfway. This leaves about 8 frames during which the bubble is at its smallest, where its scale is 1.0f.

◆ bhv_piranha_plant_waking_bubbles_loop()

void bhv_piranha_plant_waking_bubbles_loop ( void  )

Behavior for bhvPiranhaPlantBubble and bhvPiranhaPlantWakingBubbles.

This controls the bubble that grows and shrinks from a Piranha Plant's nose as it sleeps, and the smaller bubbles that explode outwards when the Piranha Plant is woken up. Main loop for bhvPiranhaPlantWakingBubbles. Initialize a random 3D velocity vector, then follow its path according to gravity.