if(can_jump==1) ?

Non-platform specific questions.

if(can_jump==1) ?

Postby Romol » Mon Feb 16, 2009 11:02 am

Why beside I do not work the action of one jump? :(
that it is necessary to do? :|
User avatar
Romol
 
Posts: 35
Joined: Mon Feb 09, 2009 11:41 am
Location: Russia
Score: 3 Give a positive score

Re: if(can_jump==1) ?

Postby jimmynewguy » Mon Feb 16, 2009 2:32 pm

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:
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: if(can_jump==1) ?

Postby Romol » Mon Feb 16, 2009 5:55 pm

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:
User avatar
Romol
 
Posts: 35
Joined: Mon Feb 09, 2009 11:41 am
Location: Russia
Score: 3 Give a positive score

Re: if(can_jump==1) ?

Postby DST » Mon Feb 16, 2009 6:36 pm

j1.jpg

j2.jpg

j3.jpg
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: if(can_jump==1) ?

Postby Romol » Tue Feb 17, 2009 1:12 pm

The Mistake no... but jumps infinitely again :cry: :cry: :cry:
here is I fool :mrgreen:
------------------------------------------------------------------------------------------
All work! all thank you !
User avatar
Romol
 
Posts: 35
Joined: Mon Feb 09, 2009 11:41 am
Location: Russia
Score: 3 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron