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
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 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
Jumping #372217
05/30/11 11:29
05/30/11 11:29
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
I know people will say go through the tutorials but as soon as I start I lose concentration. At the moment I am using:

Code:
if (key_space) 
{
me.z +=20; //if space is pressed jump
ent_animate(me,"jump",jump_percentage,ANM_CYCLE);
}
if (me.z > 25.1) 
{
c_move(me,vector(0,0,-6.5),nullvector,GLIDE); //if the player is above z.20 then glide down at 0.8 speed, enable collision
}



I want to make the model jump quite high and then glide down but this allows space to be held down and I want it so you can only press spacebar once so I assume I use a while statement I just dont know where?

Re: Jumping [Re: JakeBilbe] #372233
05/30/11 16:25
05/30/11 16:25
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pseudo Code:

When pressing the jump key
first test whether the entity is on ground
if not, do nothing
else set a variable jump_strength at a certain value above the gravity value
insert the variable at the z position of the move vector in c_move
then reduce the value of the variable jump_strength, until its almost null,
then set it to null
and, don't forget to time correct it..

Re: Jumping [Re: Pappenheimer] #372248
05/30/11 18:41
05/30/11 18:41
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
I dont suppose you could merge it with the code I posted? so that he falls gradually.

EDIT: also I have trouble concentrating on the template/workshops but if I actually got through them all would that give me enough knowledge to make a basic third person game? I will work through them later on when I get time because I really want to get into this but I just find it hard its like reading a book or something -_-

Last edited by JakeBilbe; 05/30/11 18:56.

Moderated by  HeelX, rvL_eXile 

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