Gamestudio Links
Zorro Links
Newest Posts
Why Zorro supports up to 72 cores?
by 11honza11. 04/26/24 08:55
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, VoroneTZ, Quad, 1 invisible), 837 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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 | 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