Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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