pole.inc.c (1065B)
1 2 /** 3 * Behaviors for bhvPoleGrabbing and bhvGiantPole. 4 * 5 * bhvPoleGrabbing is a generic behavior used almost anywhere the player can 6 * grab onto and climb up another object. 7 * 8 * bhvGiantPole controls the large pole in Whomp's Fortress and differs from 9 * other poles because it spawns a yellow ball that rests at its top. 10 */ 11 12 /** 13 * Initialize the hitbox height field for bhvPoleGrabbing. 14 */ 15 void bhv_pole_init(void) { 16 /** 17 * This is equivalent to using `o->oBhvParams2ndByte` according to 18 * `spawn_objects_from_info`. 19 */ 20 s32 tenthHitboxHeight = (o->oBhvParams >> 16) & 0xFF; 21 o->hitboxHeight = tenthHitboxHeight * 10; 22 } 23 24 /** 25 * Main loop for bhvGiantPole. It is equivalent to bhv_pole_base_loop() except 26 * for the fact that it spawns a yellow sphere at the top of the pole on the 27 * first frame. 28 */ 29 void bhv_giant_pole_loop(void) { 30 if (o->oTimer == 0) { 31 struct Object *topBall = spawn_object(o, MODEL_YELLOW_SPHERE, bhvYellowBall); 32 topBall->oPosY += o->hitboxHeight + 50.0f; 33 } 34 bhv_pole_base_loop(); 35 }