Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   ring problem (http://www.alice.org/community/showthread.php?t=10017)

keybasher 04-02-2013 09:37 PM

ring problem
 
1 Attachment(s)
I'm working on an assignment in which I have to create a ring catching game, and I'm almost finished, but I've run into a problem. After each attempt, whether the ring is caught or not, I have the ring move back up to the top of the screen and to a random spot left/right and in front of/behind where it was. However, the ring sometimes ends up offscreen. Is there a way to retain the randomness while keeping the ring onscreen?

Here's my file:

djslater107 04-03-2013 09:32 AM

Ring capture
 
Part of your problem is that Alice has no way of knowing the screen size or resolution setting for any individuals monitor, and the size of the runtime window...

What you might do is put an invisible object or object marker at a desired location in the world that is the appropriate hight above the ground, always tell your ring to return to that marker and then move to the left or right some random distance... Do both of these things together in time duration of 0 and you should get what you want...

keybasher 04-03-2013 07:27 PM

It worked. Thanks for your help!


All times are GMT -5. The time now is 02:21 AM.

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