Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
Camera always moves upwards?
by VoroneTZ. 02/19/26 13:13
Hedge on FXCM, 4 or 5?
by Martin_HH. 02/16/26 16:09
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, Quad, AndrewAMD), 10,074 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 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