Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 767 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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