sm64pc/src/game/behaviors/square_platform_cycle.inc.c

39 lines
997 B
C
Raw Permalink Normal View History

2019-08-25 04:46:40 +00:00
// square_platform_cycle.c.inc
2020-03-02 03:42:52 +00:00
s32 square_plat_set_yaw_until_timer(u16 yaw, s32 a) {
2019-08-25 04:46:40 +00:00
o->oMoveAngleYaw = yaw;
if (a < o->oTimer)
return 1;
else
return 0;
}
void bhv_squarish_path_moving_loop(void) {
o->oForwardVel = 10.0f;
switch (o->oAction) {
case 0:
o->oAction = (o->oBehParams2ndByte & 3) + 1;
break;
case 1:
2020-03-02 03:42:52 +00:00
if (square_plat_set_yaw_until_timer(0, 60))
2019-08-25 04:46:40 +00:00
o->oAction++;
break;
case 2:
2020-03-02 03:42:52 +00:00
if (square_plat_set_yaw_until_timer(0x4000, 60))
2019-08-25 04:46:40 +00:00
o->oAction++;
break;
case 3:
2020-03-02 03:42:52 +00:00
if (square_plat_set_yaw_until_timer(0x8000, 60))
2019-08-25 04:46:40 +00:00
o->oAction++;
break;
case 4:
2020-03-02 03:42:52 +00:00
if (square_plat_set_yaw_until_timer(0xc000, 60))
2019-08-25 04:46:40 +00:00
o->oAction = 1;
break;
default:
break;
}
2020-03-02 03:42:52 +00:00
cur_obj_move_using_fvel_and_gravity();
2019-08-25 04:46:40 +00:00
load_object_collision_model();
}