Alice Community  

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

Reply
 
Thread Tools Display Modes
While __ is pressed and stopping a loop?
Old
mevogy
Guest
 
Status:
Posts: n/a
Default While __ is pressed and stopping a loop? - 04-18-2010, 08:52 PM

In the example world flightSimulator, some of the events it has is "while arrow is pressed....", how did they do this?

Also, I have made a world where if this character gets close to another object, the object moves the distance to the character (through looped "object distance to character"). How could I end this loop when the character hits the object with something? The character may not always hit the object, and if it doesn't, I still want it to reach the character.
Hope that all made sense, thanks for any help.
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 04-18-2010, 09:14 PM

1. You drop in the "when a key is pressed" event, right click it and go change to > "while a key is pressed".

2. Using a while loop with the condition "object1 distance to object2 < X" where 'object1' and 'object2' are two separate objects and 'X' is a number of how far you want the objects to be before the while loop ends.
   
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.