Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   how to use the loops and if/else conditions? (http://www.alice.org/community/showthread.php?t=28)

 glaze 09-09-2005 01:01 AM

how to use the loops and if/else conditions?

hi, :o
my school, iligan capitol college, is probably the first school in the whole philippines or asia that teaches alice. but sad to say our teacher often left us by ourselves, neglecting to teach us the basics.
we do have a hard time using the if and else conditions, the do while loops, do together, do in order, etc.
could you please give me some hints or some infos how to use them?
could you give me some informations on how to create a game or story?
thank you very much!

glaze

 kingsamses 09-09-2005 04:00 PM

If/Else: This will execute code depending on wether a certain condition is met. Like this:
This code will move the camera forward .5 meters if the variable "number" is greater than two, and backwards if the variable is not greater than two. If the code was executed, the camera would move back.

Do while: This will repeat code until the given condition is not true.
Example:
[url="http://img373.imageshack.us/my.php?image=dowhile3pb.gif"][img]http://img373.imageshack.us/img373/1107/dowhile3pb.th.gif[/img][/url]
This will increase the value of the variable "number" and then wait for one second, repeating until [i]number[/i] is not less than five, then turn the camera.

Do together: This will execute multiple lines of code at the same time.
Example:
[url="http://img373.imageshack.us/my.php?image=dotogether8bo.gif"][img]http://img373.imageshack.us/img373/1641/dotogether8bo.th.gif[/img][/url]
This will spin the camera and move it up at the same time.

Do in order: This will execute lines of code one at a time. This is primarily used inside Do Togethers.
Example:
[url="http://img195.imageshack.us/my.php?image=dotogether1dn.gif"][img]http://img195.imageshack.us/img195/8605/dotogether1dn.th.gif[/img][/url]
This will spin the camera twice, over a two-second period. While the camera is spinning, the ground will change to red, then to blue.

 glaze 09-21-2005 12:32 AM

thank you

sigh, bad thing we do not have internet in our lab room, it could have been better if we use alice and at the same time got a connection so that we can report bugs easily and we can be taught directly..
can you suggest a good story, just a simple one to create? :confused:

 All times are GMT -5. The time now is 05:49 AM.