Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   to senior members, help please (http://www.alice.org/community/showthread.php?t=6768)

rvmurphy 06-15-2011 06:06 AM

to senior members, help please
 
1 Attachment(s)
can you look at this for me. I need to know is there a way to stop the bunny moving up/down once he has done it once.

Thanks

DensetsuNoKaboom 06-15-2011 06:20 AM

Could you be a little more clear on what you are trying to do?

I believe that the answer to your question is to make a Boolean (true/false) variable, set its value to true, and, in your checkDistance method, do this:

If world.Variable
If (whatever the conditions are)
world.Variable set value to false
bunny.bunny up
Else
[do nothing]
If (whatever the conditions are)
world.Variable set value to false
bunny.down
Else
[do nothing]
Else
[do nothing]

Did you understand all that? Basically, make a true variable, add an If/Else around your entire checkDistance method, and make the variable become false once either the bunny goes up or the bunny goes down.

Does that help at all?

rvmurphy 06-21-2011 04:25 AM

yes it did thanks for your help


All times are GMT -5. The time now is 08:23 AM.

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