ENTITY *Platform;
action Rotating_Platform()
{
Platform = me;
wait(1);
my.scale_x = 5;
while(1)
{
vec_set(my.skill1, my.pan); //store current pan/tilt/roll
me.pan += time_step; //or whatever rotations you want
vec_sub(my.skill1, my.pan); //calculate pan/tilt/roll change this frame
wait(1);
}
}
action Stay_On_Platform()
{
wait(1);
while(1)
{
vec_scale(Platform.skill1, -1); //invert Platform angle change
VECTOR tmpV;
vec_diff(tmpV, me.x, Platform.x); //calculate positional vector with Platform origin as center
vec_rotate(tmpV, Platform.skill1); //rotate aroung the origin
vec_add(tmpV, Platform.x); //calulate back to World co-ordinates
vec_sub(tmpV, me.x); //calculate absolute vector to move to
c_move(me, NULL, tmpV, NULL); //move there, checking for collisions
c_rotate(me, Platform.skill1, NULL); //rotation inherited from platform
vec_scale(Platform.skill1, -1); //invert Platform angle change BACK in case something else uses it
wait(1);
}
}