OP
User
Joined: Oct 2005
Posts: 528
Italy
|
Quote:
no, what you have is fine.
As for the complete Code:
var video_mode= 8; var video_screen= 1; var video_depth= 32;
var count_of_ents;
ENTITY* _ball;
action ball { _ball= me; ph_setgravity (nullvector); ph_fps_max_lock= 75; phent_settype (my,PH_RIGID,ph_sphere); phent_setmass (my,3,ph_sphere); phent_setfriction (my,30); phent_setelasticity (my,50,10); wait(-30); ent_remove(me); count_of_ents-= 1; }
ENTITY* cam;
action dummy_cam { cam= me; phent_settype (my,PH_RIGID,ph_box); phent_setmass (my,10,ph_box); phent_setfriction (my,10); phent_setelasticity (my,20,10); phent_setdamping(my,90,90); while(1) { phent_addtorquelocal (my,vector(0,20 * (mouse_force.y * time_step * -1),0)); phent_addtorquelocal (my,vector(0,0,20 * (mouse_force.x * time_step * -1))); phent_addvellocal (my,vector(25 * (mouse_left - mouse_right) * time_step,0,0),nullvector); if(mouse_middle== on) { phent_addtorquelocal (my,vector(25 * (mouse_force.x * time_step),0,0)); } camera.pan= my.pan; camera.tilt= my.tilt; camera.roll= my.roll; camera.x= my.x; camera.y= my.y; camera.z= my.z; wait(1); } }
function spawn_ball() { count_of_ents+= 1; ent_create ("earth.mdl",vector(random(200),random(-200),random(200)),ball); phent_addvellocal (_ball,vector(random(50),random(-50),random(-50)),vector(random(-20),random(15),random(-10))); while(1) { vec_set(temp,vector(_ball.x,_ball.y,_ball.z)); vec_to_screen(temp,camera); draw_line(temp,vector(255,255,255),100); draw_line(vector(512,384,0),vector(255,255,255),100); wait(1); } }
function main() { level_load ("0g_experience.wmb"); on_space= spawn_ball; }
panel _diag { digits(0,0,"Number of ents= %1.0f",_a4font,1,count_of_ents); flags= visible; }
This is a script I wrote to test the A7 unlimited physics.
I tryed this in A7 and it does not working; the balls are inamovible. 
|