Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Need help regarding events (http://www.alice.org/community/showthread.php?t=9781)

Kimura 12-13-2012 07:43 PM

Need help regarding events
 
1 Attachment(s)
Hey guys, I am doing a project for school and need help. Basically, I am trying to make it so my astronaut hops around on the moon until he reaches the spheres. My if/else statement has an issue. If astronaut is within 5 meters of helium3red1, then sphere will not show. Else: every sphere continues to show. My world is not set up for completion right now, it is in a testing state, so that is why if he gets close to helium3red1, every other sphere will not show.

My theory is that the if/else will not work based on the aftermath of a driven event, such as a typed key like I have. How can I move my astronaut while still affecting the within 5 meter threshold? Thank you, I attached my project.

Kimura 12-13-2012 08:16 PM

1 Attachment(s)
I am getting closer. I inserted a while statement. Notice that when you move the loop statement to trash in the "HeliumAnim" Method, that the spheres work as I intended, the astronaut moves 5 meters within and they disappear. When the loop is in this statement, they do not disappear. I want the loop because it makes the spheres change from red to yellow. I attached my revised world. Please help, I am sure it is something simple I am missing!

Kimura 12-13-2012 10:30 PM

1 Attachment(s)
Ok this is as far as I got today. I no longer care about the changing colors, I just want my astronaut to collect all the heliums, return to the ladder, and when he gets to it, Alice becomes visible and hands him a prize (SeeAlice method will ensue when astronaut is within x meters of sphere2, which is an invisible dummy object). I know that it's gotta have something to do with the while something is true event (begin during end). I tried them all and I still get stuck. Again, I have attached my revised world. Sorry if I am posting to much but this is driving me crazy and it is due in 4 days and I am trying to simplify this as much as possible.

Kimura 12-14-2012 01:08 AM

1 Attachment(s)
Well I figured it out because I would not let myself give up, it was driving me nuts I couldn't sleep! I made a while something is true event, and made it so when the astronaut was in front of something, a certain method would take place, which was Alice handing the astronaut a prize.

There were still some things I wanted to do but I couldn't end up finding a way to do, and a few glitches that could take place if one does not follow the instructions thoroughly during the game, but hey, every game has glitches, right? Just letting you guys know that I am done with that exercise and I realized tonight that there is more than one way to do something. After I stopped trying to fix one thing that didn't work over and over again, and tried something new and different, the majority of the time, that is how I found success. Attached is my finished product.

HaloMike117 12-15-2012 09:08 PM

[QUOTE=Kimura;51964]Well I figured it out because I would not let myself give up, it was driving me nuts I couldn't sleep! I made a while something is true event, and made it so when the astronaut was in front of something, a certain method would take place, which was Alice handing the astronaut a prize.

There were still some things I wanted to do but I couldn't end up finding a way to do, and a few glitches that could take place if one does not follow the instructions thoroughly during the game, but hey, every game has glitches, right? Just letting you guys know that I am done with that exercise and I realized tonight that there is more than one way to do something. After I stopped trying to fix one thing that didn't work over and over again, and tried something new and different, the majority of the time, that is how I found success. Attached is my finished product.[/QUOTE]

Awesome.

Glad to see you got things sorted! (:

mcelroy32400 12-18-2012 06:11 PM

[QUOTE=Kimura;51960]...Ok this is as far as I got today. I no longer care about the changing colors, I just want my astronaut to collect all the heliums....[/QUOTE]

I laughed when I read this sentence. Anyone who has put some good effort into any Alice program totally knows that feeling of "Ok, forget it. I wanted to add something really cool to my thing so the program would be really nice like I imagined, but the piece of garbage won't work - so just forget it. I don't care anymore. I just need to make the actual thing work now."

Interesting little game. I like the prize at the end. In the future, for game-play sake you might want to speed things up; instead of 2 seconds for up and 2 for down (totaling 4), maybe just do .5 seconds for each. This still gives the slow motion of moon bouncing but speeds the game up. Another suggestion, change your events from "When a key is typed" to "While a key is pressed" (right click the event and choose 'change to' option) - this way the user can just hold a key down and the method will be called over and over until the user stops pressing the key. Overall, good little game!


All times are GMT -5. The time now is 01:10 PM.

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