player:
Code:
function player_gravity()
{
vec_set(temp,my.x);
temp.z -= 4000;
trace_mode = ignore_me+ignore_sprites+IGNORE_MODELS+USE_BOX;
if (result>5)
{
force.X = 0;
force.Y = 0;
force.Z = -5;
friction = 0;
szar=1;
}
if (result<3)
{
force.X = 0;
force.Y = 0;
force.Z = -10*result;
friction = 20;
szar=0;
}
}
action move_me
{
player=my;
while (1)
{
player_gravity();
vec_set(temp,my.x);
temp.z -= 4000;
trace_mode = ignore_me+ignore_sprites+IGNORE_MODELS+USE_BOX;
my.skill13 = time*force.z + max(1-time*friction,0)*my.skill13;
dist.x = 0;
dist.y = 0;
dist.z=time*my.skill13;
move_mode = ignore_passable + glide;
ent_move(dist,nullvector);
wait(1);
}
}
domino:
Code:
action box_grav
{
phent_settype(my,PH_RIGID,PH_box);
phent_setmass(my,23,PH_box);
phent_setfriction(my,25);
phent_setelasticity(my,0,0);
phent_setdamping(my,50,90);
ph_setgravity( vector(0,0,-386) );
}