Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
jump #279801
07/19/09 11:47
07/19/09 11:47
Joined: Jul 2009
Posts: 16
E
episch Offline OP
Newbie
episch  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 16
I wanna make a 3d jump and run but my problem is the jump part of the script in combination with the gravitation code.
Code:
function jump ()
{
	if(jump_hight<500)
	{
	
		dist_down=100;
	
	}
	else
	{
	
		dist_down=-1000;
	}
}
action spieler(){

vec_for_min(boden,me);
player = me;
	while(1){
		if (c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) > 0){
			dist_down = my.z + boden.z - target.z;
		}else {
		dist_down = 0;
	}
	if (dist_down > 0){
	dist_down = clamp(dist_down,0,accelerate(speed_down,5,0.1));
	}else{
	speed_down = 0;
		if(!key_space)
			{
				dist_down=500;
			}
}var dist_ahead = 5*(key_w-key_s)*time_step;
c_move(me,vector(dist_ahead,0,0),vector(0,0,-dist_down),IGNORE_PASSABLE| GLIDE);
if(mouse_pos.x < 640){
my.pan = 180;
}
else{
	my.pan = 0;
}

		camera.x = my.x ;
		camera.y = my.y -500;
		camera.z = my.z;
		wait(1);
	}
}





this code work not clean. my model is under the ground .


can sombody help my the fix this problem

Re: jump [Re: episch] #279804
07/19/09 11:56
07/19/09 11:56
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
set this at the start of your player code, c_setminmax(me);

Re: jump [Re: Rei_Ayanami] #279810
07/19/09 12:30
07/19/09 12:30
Joined: Jul 2009
Posts: 16
E
episch Offline OP
Newbie
episch  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 16
i have try this. the player stand now on the ground butthe player downt jump


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1