Synchronized sliding platform 2

This commit is contained in:
MysterD 2020-08-28 20:26:17 -07:00
parent 398f5e8345
commit cb5dcaa4f4

View file

@ -34,6 +34,20 @@ void bhv_sliding_plat_2_init(void) {
}
void bhv_sliding_plat_2_loop(void) {
if (network_sync_object_initialized(o)) {
struct SyncObject* so = network_init_object(o, 1000.0f);
so->maxUpdateRate = 5.0f;
network_init_object_field(o, &o->oBackAndForthPlatformUnkFC);
network_init_object_field(o, &o->oBackAndForthPlatformUnk100);
network_init_object_field(o, &o->oPosX);
network_init_object_field(o, &o->oPosY);
network_init_object_field(o, &o->oPosZ);
network_init_object_field(o, &o->oVelX);
network_init_object_field(o, &o->oVelY);
network_init_object_field(o, &o->oVelZ);
network_init_object_field(o, &o->oTimer);
}
if (o->oTimer > 10) {
o->oBackAndForthPlatformUnkFC += o->oBackAndForthPlatformUnk100;
if (clamp_f32(&o->oBackAndForthPlatformUnkFC, -o->oBackAndForthPlatformUnkF8, 0.0f)) {