Page 1 of 1

if(can_jump==1) ?

PostPosted: Mon Feb 16, 2009 11:02 am
by Romol
Why beside I do not work the action of one jump? :(
that it is necessary to do? :|

Re: if(can_jump==1) ?

PostPosted: Mon Feb 16, 2009 2:32 pm
by jimmynewguy
make a varible called jump
on the key down you want to have the player jump put
Code: Select all
if(jump == 1)//if the varible jump equals 1 and only one do the things in the brackets {}
{
yvelocity -= 10;//change  the yveloicty to make the player go up
jump = 0;//change the varible so the player can't jump twice
}


then when you collide with the topside of "ground" put
Code: Select all
jump = 1;//resets the jump varible to jump again

:mrgreen:

Re: if(can_jump==1) ?

PostPosted: Mon Feb 16, 2009 5:55 pm
by Romol
Is not got again !

Error line 1: Undeclared identifier jump
Warning line 1: Possible non relational operation
Error line 1: Undefined type for relational operation
Error line 4: Incopatible types: cannot from 'const int' to 'identifier'

if possible on-in detail :roll:

Re: if(can_jump==1) ?

PostPosted: Mon Feb 16, 2009 6:36 pm
by DST
j1.jpg

j2.jpg

j3.jpg

Re: if(can_jump==1) ?

PostPosted: Tue Feb 17, 2009 1:12 pm
by Romol
The Mistake no... but jumps infinitely again :cry: :cry: :cry:
here is I fool :mrgreen:
------------------------------------------------------------------------------------------
All work! all thank you !