Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
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
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | 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