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
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Gravity with jumping [Re: MasterQ32] #311657
02/21/10 10:54
02/21/10 10:54
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Thank you. I'll play with this laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #311664
02/21/10 11:01
02/21/10 11:01
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
hopfel Offline
User
hopfel  Offline
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
EDIT: shit too late -.-

I tried to code something, not tested, hope it works ^^

var gravity=0;
var my_height=0;

function gravityandjumps()
{
my_height = c_trace(my.x,vector(my.x,my.y,my.z-10000),USE_BOX|IGNORE_PASSABLE|IGNORE_ME);

if(my_height > 5) { //if I'm flying
my.z-=gravity*time_step; //push me down
gravity+=1*time_step;} //realistc falling
else
if(my_height < 4) //if I'm going uphill
{my.z-= my_height-4.5;} //push me up
else //else
{gravity=0; //set gravity on zero
if(key_space) //if you will jump
{my.z+=3*time_step; //push me up
gravity=-20;} //and set the gravity on -20
}

}





Last edited by hopfel; 02/21/10 11:02.

Hilf mir, dir zu helfen!
Re: Gravity with jumping [Re: hopfel] #311668
02/21/10 11:05
02/21/10 11:05
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Thank you to bro laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #313808
03/03/10 18:22
03/03/10 18:22
Joined: Dec 2009
Posts: 57
USA
M
marianschuth Offline
Junior Member
marianschuth  Offline
Junior Member
M

Joined: Dec 2009
Posts: 57
USA
Ich hab direkt das erste Beispiel ausprobiert und es klappt perfekt! Vielen Dank!!

Page 2 of 2 1 2

Moderated by  HeelX, Tobias_Runde 

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