Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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