I want to make a small game.One ball is in plank above,Control the plank rotate. Ball is able to roll on the plank,But ball now or passing plank. Or stop not moving in overhead. . Can help me what?

#include <acknex.h>
#include <default.c>

action ball()
{
my->flags &= ~PASSABLE;
ph_setgravity (vector(0, 0, -386));
phent_settype (my, PH_RIGID, PH_SPHERE);
phent_setmass (my, 40, PH_SPHERE);
phent_setfriction (my, 90);
phent_setdamping (my, 70, 70);
phent_setelasticity (my, 50, 40);
my.material = mat_metal;
while(1)
{
camera.x = my.x - 200;
camera.y = my.y;
camera.z = my.z + 200;
camera.tilt = -45;
wait(1);
}
}

action board_rotate()
{
my->flags &= ~PASSABLE;
while(1)
{
if(key_s && my.tilt <= 20)
{
c_rotate(my,vector(0,2*time_step,0),USE_AABB|USE_AXISR);
}
if(key_w && my.tilt >= -20)
{
c_rotate(my,vector(0,-2*time_step,0),USE_AABB|USE_AXISR);
}
if(key_d && my.roll <= 20)
{
c_rotate(my,vector(0,0,2*time_step),USE_AABB|USE_AXISR);
}
if(key_a && my.roll >= -20)
{
c_rotate(my,vector(0,0,-2*time_step),USE_AXISR|USE_AABB);
}
wait(1);
}

}

function main()
{
level_load("game.wmb");
}