Here the code :
Code:
#include <acknex.h>
#include <default.c>

ENTITY* pointer;
VECTOR global;
VECTOR check;
VECTOR jump;

var checkj = 0;

function main() 
{
	video_screen = 2;
	video_mode = 8;	
	mouse_mode = 1;	
   fps_max = 60;  
   wait(-1);
	level_load ("level1.wmb"); 
   ph_setgravity (vector(0, 0, -700));   
} 


action playerj() 
{
  pointer = my;
  my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); 
  phent_settype (pointer, PH_RIGID, PH_SPHERE); 
  phent_setmass (pointer, 1, PH_SPHERE);
  phent_setfriction (pointer, 500); 
  phent_setdamping (pointer, 50, 50); 
  phent_setelasticity (pointer, 0, 0);
  
  jump.x = 0; jump.y = 0; jump.z = 150;  

   while (1) {    
  	  global.x = my.x ;
  	  global.y = my.y ;
  	  global.z = my.z ;
  	  
  	  check.x =  my.x;
  	  check.y =  my.y;
  	  check.z =  my.z-23; //the height of the ball/2
  	   
     checkj = c_trace(global,check,USE_BOX);
     
     if(key_space && checkj != 0)
     {     
         phent_addvelcentral(pointer,jump);
     }
     wait (1); 
  }

}

And here the whole project, jump with space :
http://www.file-upload.net/download-1482643/testjump.rar.html
Be a bit patient, sometimes the weird timing needs a few jumps to get visible wink

Last edited by theDust; 02/25/09 12:41.