Alice Community  

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

Reply
 
Thread Tools Display Modes
Need help with loops and specifically for this world at this point
Old
kjobrien
Guest
 
Status:
Posts: n/a
Default Need help with loops and specifically for this world at this point - 06-23-2010, 04:37 PM

Now I have the snowman moving twards the stool like he should be. My Question is how do I get the loop to stop when the snowman gets within a certian distance of the stool to avoid the collision. I can only put integers into the loop repeat slot how can i get alice to relize that the loop needs to stop before i collide with thte stool?
Attached Files
File Type: a2w 7. Snowman to Stoolv2Loop.a2w (166.5 KB, 20 views)
   
Reply With Quote
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Default 06-24-2010, 03:43 PM

can you not make something like this? Just make it that if the snowman is far enough away, move the snowman.

-loop infinity

--if (_snowman_) distance to (_target_) is ((_> than_) (_10_))

-----(_snowman_) Move towards (_target_) distance= 0.1 duration = 0.1

--

-

change the 10 and the duration of the movement to whatever the distance needs to be. Remember that the faster the duration is and smaller the distance is, the more accurate the distance is going to be to the target, since it checks more often.


im back!!! FINNALY!!! got windows working on my mac again!!!
   
Reply With Quote
Thank you rich0e0rick
Old
kjobrien
Guest
 
Status:
Posts: n/a
Default Thank you rich0e0rick - 06-24-2010, 04:13 PM

That is exactly how I worked this one too and you are right with your reply it works perfect that way thanks for all you help

Last edited by kjobrien; 06-24-2010 at 04:14 PM. Reason: speeling lol
   
Reply With Quote
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Default 06-26-2010, 02:01 PM

no problem


im back!!! FINNALY!!! got windows working on my mac again!!!
   
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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.