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
1 registered members (TipmyPip), 18,619 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
Simple Gravity #200363
04/03/08 17:59
04/03/08 17:59
Joined: Oct 2007
Posts: 116
S
sydan Offline OP
Member
sydan  Offline OP
Member
S

Joined: Oct 2007
Posts: 116
Does any one have any suggestions for a simple easy short code gravity system that works effectively? I need the objects to fall but also be able to slide along the floor and down slopes under gravity.

If youve got any ideas please reply.

Sydan


For some reason, my ambition always seems to beat my ability.
Re: Simple Gravity [Re: sydan] #200450
04/04/08 06:42
04/04/08 06:42
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
this is something from my head:

 Code:
...
var zForce;
...
action player()
{
...
	vec_set(temp, my.x);
	temp.z -= 4000;
	c_scan(my.x, temp, IGNORE_ME | IGNORE_PASSABLE);

	if(result <= 32)
	{
		zForce = 0;
	}
	else
	{
		zForce += 6.7 * time_step;
		if(zForce >= 9.674)
		{
			zForce = 9.674;
		}
	}
	
	move.z += -zForce;
	c_move(me, move, nullvector, GLIDE | USE_AABB);

	vec_set(temp, my.x);
	temp.z -= 4000;
	c_scan(my.x, temp, IGNORE_ME | IGNORE_PASSABLE | GLIDE);

	if(result >= 0)
	{
		my.z += result*time_step;
	}
...
}


I'd be surprised if it works, but basically it goes somewhat like that.


"Yesterday was once today's tomorrow."

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

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