Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How would you make an object walk forward 3 times with a loop count of 2?
Old
Myo
Guest
 
Status:
Posts: n/a
Default How would you make an object walk forward 3 times with a loop count of 2? - 05-14-2009, 03:58 PM

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

Last edited by Myo; 05-23-2009 at 11:24 PM.
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 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?
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default 05-14-2009, 07:08 PM

Quote:
Originally Posted by Myo View Post
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
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"

Last edited by HisWorld; 05-14-2009 at 07:11 PM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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