Alice Community  

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

Reply
 
Thread Tools Display Modes
ring problem
Old
keybasher
Member
 
Status: Offline
Posts: 17
Join Date: Jan 2013
Default ring problem - 04-02-2013, 09:37 PM

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:
Attached Files
File Type: a2w Lab3-JT.a2w (333.8 KB, 22 views)
   
Reply With Quote
Ring capture
Old
djslater107
Administrator
 
Status: Offline
Posts: 155
Join Date: Jan 2007
Default Ring capture - 04-03-2013, 09:32 AM

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...


Don Slater
Alice Team
Carnegie Mellon University
   
Reply With Quote
Old
keybasher
Member
 
Status: Offline
Posts: 17
Join Date: Jan 2013
Default 04-03-2013, 07:27 PM

It worked. Thanks for your help!
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.