While and If

Game Editor comments and discussion.

While and If

Postby asmodeus » Sat Nov 24, 2007 10:09 pm

What's the different from while and if the script editor?
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: While and If

Postby pixelpoop » Sun Nov 25, 2007 4:49 am

I believe "While" statements will keep looping back through the code within the current frame while the condition exists. It could be possible that the condition is never met and the computer keeps rereading the code (never advancing to the next frame) and then crash.

An "if" statement only checks the condition once and then goes on.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Re: While and If

Postby Fuzzy » Sun Nov 25, 2007 9:26 am

Its also possible that a while never executes at all. If its important that it does, you should use a for loop
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

Re: While and If

Postby Kalladdolf » Sun Nov 25, 2007 11:58 am

is there also a funtion called "wait"?
I know in lite-c there it is, saying
Code: Select all
wait(1);

(tells the computer to wait 1 frame)
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: While and If

Postby Kalladdolf » Mon Dec 17, 2007 6:19 pm

um... this was a question.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: While and If

Postby Game A Gogo » Tue Dec 18, 2007 12:39 am

no
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: While and If

Postby Kalladdolf » Wed Jan 02, 2008 8:27 pm

something similar?
I know that in lite-c "wait()" exists...
but how about GE?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: While and If

Postby Game A Gogo » Thu Jan 03, 2008 12:15 am

It doesn't have it, if you check in the GE Documentation, it does not have it.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: While and If

Postby Kalladdolf » Thu Jan 03, 2008 7:12 pm

:(
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: While and If

Postby Bee-Ant » Thu Jan 03, 2008 7:19 pm

generally...
Code: Select all
do
{
    //something
}
while
{
   //the limit to do
}
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


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron