Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   How would you make an object walk forward 3 times with a loop count of 2? (http://www.alice.org/community/showthread.php?t=2659)

Myo 05-14-2009 03:58 PM

How would you make an object walk forward 3 times with a loop count of 2?
 
I'm really confused since I don't even know what a loop does
Please answer ASAP if you know what a loop does or if you know the answer to the quesition in the title! :( I'll greatly appreciate it ;)

Scott300 05-14-2009 07:02 PM

var bool loopstop = false
loop 2 times
{
if world.loopstop = false
{
Walk command 1
Walk command 2
loopstop = true
}
else
{
Walk command 3
}

Something like this?

HisWorld 05-14-2009 07:08 PM

[QUOTE=Myo;10154]I'm really confused since I don't even know what a loop does
Please answer ASAP if you know what a loop does or if you know[/QUOTE]
:) some kind of school project?

So what have you tried so far? Have you completed the tutorial's?

Well all of your conditional statements are found on the bottom of the method pane.

One of these is called "loop" this is like a for-loop. All of the code inside the loop will be run from the first line to the last and then repeat a certain number of times based on what number you give it.

Inside the loop statement you will need the command to make your character walk forwards.

Everytime your code is run or looped your character will move forwards. To have pauses between each time he walks add a "wait"


All times are GMT -5. The time now is 02:53 PM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.