another noob question

Game Editor comments and discussion.

another noob question

Postby drinkingpee » Sat Jul 31, 2010 8:58 am

could any of you explain what a "conditional statement" is and how can i use it?, the simpler it is the better :D :D :D
drinkingpee
 
Posts: 13
Joined: Tue Jul 27, 2010 4:01 pm
Score: 1 Give a positive score

Re: another noob question

Postby Bee-Ant » Sat Jul 31, 2010 9:49 am

Conditional statement is where you code with conditional code, such as IF, FOR, WHILE, etc...
Here's the example :
Code: Select all
int count;
int number;
if(count<100) //if count value is under 100
{
    number+=1; //add number by 1
}

Code: Select all
int loop;
int number;
for(loop=0;loop<100;loop++) //for loop is equal 0 and under 100, add loop by 1
{
    number+=1; //add number by 1 while adding the loop
}

Code: Select all
int loop;
int number;
while(loop<100) //while loop value is under 100
{
    number+=1; //add number by 1
}

3 of those would store the same value, it's number=100
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: another noob question

Postby savvy » Sun Aug 01, 2010 12:24 pm

or
Code: Select all
if(jump==1)
{
yvelocity=-8;
jump=0;
}
else
{
yvelocity=2;
}

that code makes the player jump...or dive!
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: another noob question

Postby drinkingpee » Sun Aug 01, 2010 5:55 pm

thanks for the help guys :D :D
drinkingpee
 
Posts: 13
Joined: Tue Jul 27, 2010 4:01 pm
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron