Alice Community  

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

Reply
 
Thread Tools Display Modes
Make an object stop looping.
Old
NB3115
Guest
 
Status:
Posts: n/a
Default Make an object stop looping. - 12-15-2010, 08:46 PM

Ok... so I have zombies following the camera... and once you click on one it "dies". But the problem is, I have it in a loop statement, and even after it dies, it still follows the camera. Any help on how to get it to stop???
   
Reply With Quote
Old
haven812
Guest
 
Status:
Posts: n/a
Default 12-15-2010, 10:12 PM

Instead of using a loop, use a while loop. This will loop as long as something returns true. You could create a boolean variable that is called hasBeenKilled. When the zombie gets clicked, set the hasBeenKilled variable to true. Your code could now look like this

Code:
While hasBeenKilled==false
zombie follow character
zombie set vehicle to world
Code:
When the mouse is clicked on zombie
zombie.hasBeenKilled set value to true
I hope this helped!
   
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.