Alice Community Disappearing Act Help

OwningDTW
Guest

Status:
Posts: n/a
08-06-2010, 05:27 PM

Quote:
 Originally Posted by georgie7896 I am having a similar issue I have my random part OK but I can not figure out how you click on a bug and make it disappear. Anyone able to help? Here is what I have so far. I tried to click on create new method and while it was open click on properties but the program would not allow me to do so. Please help Thanks Ginger
Can anyone lend a helping hand here in terms of the random movements?

 Dameria Senior Member     Status: Offline Posts: 978 Join Date: Sep 2009 Location: United States 08-06-2010, 05:33 PM Well if you want a person to randomly turn a certain degree, just make an if/else statement in the part where you want them to move (you can make it in an infinite loop if you want them to always move randomly) and then put in the turn method for the object you want to turn. When it says rotations, just put in the random number function found in world.functions and put Minimum: 0, Maximum: 1. This will make the person turn a random degree from where they are turning right now (it is your choice whether to turn them right or left, you can even make a random function for that too). Then for the distance you can also put in the random function and say put any minimum or maximum you want there. Check out my best projects so far and please comment: Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548 Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408 Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725 Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
OwningDTW
Guest

Status:
Posts: n/a
08-06-2010, 08:03 PM

Quote:
 Originally Posted by Dameria Well if you want a person to randomly turn a certain degree, just make an if/else statement in the part where you want them to move (you can make it in an infinite loop if you want them to always move randomly) and then put in the turn method for the object you want to turn. When it says rotations, just put in the random number function found in world.functions and put Minimum: 0, Maximum: 1. This will make the person turn a random degree from where they are turning right now (it is your choice whether to turn them right or left, you can even make a random function for that too). Then for the distance you can also put in the random function and say put any minimum or maximum you want there.
Thanks for the response. My group members and I are still stumped, however, on the whole part of this assignment that requires us to trigger a common method to make an object disappear. I've read chapter 6 over and over and so have my group mates. We still can't figure this out.

 Dameria Senior Member     Status: Offline Posts: 978 Join Date: Sep 2009 Location: United States 08-06-2010, 11:28 PM That one is easy. I don't know exactly what you need to do for the program, but you need to use a parameter in your method. I will explain it as if your project was to make an object disappear when you click on it: Create a "When mouse is clicked on something" event in the event panel and leave the rest of the event alone for now. Now create a world method and call it "disappear", or anything else you want to call it. In this method, create a parameter and make it an object parameter, call it "clickedObject". Now go to any object in the objects list you want and go to the properties. Look for the "opacity", and drag that into the "disappear" method, and make it turn to "0.0". It should now say "(objectName) set opacity to 0(0%)" in the method. Now, drag that parameter called "clickedObject" into the line of code where it says "(objectName)" so that it says "clickedObject set opacity to 0(0%)". Ok so now you are done with the disappear method. Now drag the "disappear" method from the method box into the mouse click event where it says "When mouse is clicked on Anything, do Nothing", you have to switch it out with the "Nothing" part. It should be done now, just run the world and test it, and tell me if I missed anything or if its too confusing, I could create an example if you don't get it. Check out my best projects so far and please comment: Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548 Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408 Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725 Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301