Alice Community  

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

Reply
 
Thread Tools Display Modes
Getting an object to "spin" randomly
Old
emerica4now
Guest
 
Status:
Posts: n/a
Default Getting an object to "spin" randomly - 12-16-2009, 11:42 AM

here is what i am supposed to do.

create a world that contains the following:

1. 4 Ballerinas
2. Place all the ballerina objects in a list
3. When the "B" alphabet is clicked, they should all spin simultaneously in the clockwise direction 2 times.
4. When the "S" alphabet is clicked, they should spin one by one counter-clockwise direction for a random number of times.

I have got the first 3 parts but do not know how to do the 4th step can somone please help, thanks I really appreciate it.
   
Reply With Quote
Old
Delpenator
Guest
 
Status:
Posts: n/a
Default 12-16-2009, 02:35 PM

first, create a random variable called spin (to do this create a world variable). Then, create a new method for this. Use this method in the event when s is typed. then, create the numbers value to the function random number(can only do this by drag and drop) . I recommend chenging the max and min values of the random number function by clicking more. Then do in order, one turn spin amount, then the next, and so on.

Also since you are turning set the random's range to be from 1 to 360 and divide by 360, otherwise you will spin way more than you want.
   
Reply With Quote
Old
emerica4now
Guest
 
Status:
Posts: n/a
Default 12-16-2009, 07:07 PM

Thanks alot that eally helped : )
   
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.