the 'if' function

Game Editor comments and discussion.

the 'if' function

Postby nappie » Tue Jul 25, 2006 8:09 pm

i know how to use this one from my short flash experience ^^
but how do you use it precisely in GE?

will anyone give me a short briefing? tx in advnce
nappie
 
Posts: 15
Joined: Sun Jul 23, 2006 9:10 pm
Score: 0 Give a positive score

Postby Fuzzy » Wed Jul 26, 2006 7:05 am

I'm the wrong guy to ask... ;)
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby DilloDude » Wed Jul 26, 2006 7:55 am

Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby nappie » Wed Jul 26, 2006 2:02 pm

ty :)

and how do you set a condition?
get 2 slices of bread, put a bunch of cheese and 1 slice of ham between it. put butter on the outsides of the slices of bread, and put them into a grill for 2 min. ---> TOSTI!
nappie
 
Posts: 15
Joined: Sun Jul 23, 2006 9:10 pm
Score: 0 Give a positive score

Postby DilloDude » Wed Jul 26, 2006 11:10 pm

you can use ==(equal), != (not equal), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to) as well as && (and), || (or). Then add you statements. So you could have:
Code: Select all
if (variable1 >= variable2 && (variable3 == variable4 || variable3 <= variable5))

If you don't use anything to compare with, it will be not equal to zero:
Code: Select all
if (variable)
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron