Alice Community  

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
I Need Help With "mouse distance to" Functions
Old
JAA
Member
 
JAA's Avatar
 
Status: Offline
Posts: 31
Join Date: Jul 2010
Default I Need Help With "mouse distance to" Functions - 07-11-2010, 10:26 PM

I made a simple world with the following event:

When the world begins do [world.my first method]

...and the following method:

world.my first method
While [true]
-Print [mouse distance to left edge]
-Print [mouse distance to top edge]

My goal was to get a print out of the mouse's position relative to the left and top edge of the screen as I move the mouse around. Instead it just keeps printing:

"the value of world.my first method mouse distance from left edge is none"
"the value of world.my first method mouse distance from top edge is none"

...as I move the mouse around.

I can't figure out why this is the case, can someone help me?

If I could get Alice to recognize these values I would make the following events:
(note: L = distance from left edge of screen to the center of the screen
: T = distance from top edge of screen to the center of the screen)

While [mouse distance from left edge > L]
Beginning:
During: [camera turn left at speed [1/4 revolution] per [1]second]
End:

While [mouse distance from right edge < L]
Beginning:
During: [camera turn right at speed [1/4 revolution] per [1]second]
End:

While [mouse distance from left edge > T]
Beginning:
During: [camera turn forward at speed [1/4 revolution] per [1]second]
End:

While [mouse distance from left edge < T]
Beginning:
During: [camera turn backward at speed [1/4 revolution] per [1]second]
End:

...Then I'd throw in a tiny "+" at the center of the screen with its vehicle set to the camera.
Why can't it be this simple?!!!!!!
I know that that the above events would make it nearly impossible to keep the screen still but i don't care for now. I just want this basic thing to work and I'll tweak it later.


Out of the 7 schools I applied for, Carnegie Mellon is the only one that didn't accept me. They wait listed me, but I hold no grudges. Alice is awesome and Claytronics , om*g. Some one should figure out how to put these two projects together. It would revolutionize not only the gaming industry, but the world... scratch that, the Universe... scratch that, the Multiverse!

Last edited by JAA; 07-11-2010 at 10:49 PM.
   
Reply With Quote
 

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.