Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by AndrewAMD. 12/06/23 17:16
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (AndrewAMD, miwok, TipmyPip, 3run, 1 invisible), 636 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
maybe a problem about gravity? not sure... #373698
06/12/11 10:07
06/12/11 10:07
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline OP
Member
tzw  Offline OP
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
hi everybody, i am working on a standard ACT game.
but i got some problems on the chara's moving,
when the player Glides along the ground especially a terrain ,
the player "shakes" up and down quickly.

i guess the resaon is my gravity codes,but not sure
my gravity code :

Code:
function gravity_handle()
{
	static var fall_speed=0;

	VECTOR temp3;
	var current_height=0;
	vec_set(temp3.x, my.x);
	temp3.z -= 1000;
	
	if( c_trace(my.x, temp3.x,  IGNORE_PASSABLE  )>0)
	{
		current_height =my.z-player_body_height- target.z;
	}
	if(current_height <1*0.8) 
	{
		fall_speed= 4*time_step;
	}
	else
	{
		if(current_height >= 1 ) 
		{
			fall_speed -=15*time_step;
		}
		else 
		{
			fall_speed =0; // 
		}
	}
	c_move(me,NULL,vector(0,0,fall_speed),IGNORE_PASSABLE);
}



i invoke this function per frame in the player's action.
thanx in advance.~~~~


and the map which i use is from the rpg template.


Last edited by JustSid; 06/12/11 11:20.

Full of my eyes are class struggles.....
Re: maybe a problem about gravity? not sure... [Re: tzw] #373728
06/12/11 13:50
06/12/11 13:50
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline OP
Member
tzw  Offline OP
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
someone please..


Full of my eyes are class struggles.....

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