Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I make things move at Random
Old
Jackweird
Junior Member
 
Status: Offline
Posts: 1
Join Date: Apr 2013
Default How do I make things move at Random - 04-20-2013, 09:55 PM

I am running into a issue on one problem i have what i have to do is

1. Create a generic random movement method that will use random numbers to pick a direction and a amount, and will cause a butterfly to move accordingly

2. and also Place six butterflies in a list and create a methods and events to make all of the butterflies fly around gently in an Alice world, flapping their wings and moving about randomly

If some one could point me in the right direction it would be great
   
Reply With Quote
Go west young man :)
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 212
Join Date: Dec 2012
Location: Frosno, Ca
Default Go west young man :) - 04-21-2013, 01:46 PM

Quote:
Originally Posted by Jackweird View Post
I am running into a issue on one problem i have what i have to do is

1. Create a generic random movement method that will use random numbers to pick a direction and a amount, and will cause a butterfly to move accordingly

2. and also Place six butterflies in a list and create a methods and events to make all of the butterflies fly around gently in an Alice world, flapping their wings and moving about randomly

If some one could point me in the right direction it would be great
If you have Learning to program with Alice look in the Tips and Techniques section of Chapter 6 at the Random motion example.

Basically you want to move each object a random amount up/down, left/right and forward/back. This is usually accomplished in three lines, one for each pair of directions. and giving the "random number" function (under world/function) a minimum that is negative and a maximum that is positive. So, for instance, the butterfly move instruction might look like this:
butterfly move up random number minimum = -0.05 Maximum = 0.05

Hope that helps
   
Reply With Quote
Help
Old
adriana1calle
Guest
 
Status:
Posts: n/a
Default Help - 04-23-2013, 02:41 PM

I want to make some things like those, what do you reccomend? thanks!


-------------------------
casas en venta en cuenca

Last edited by adriana1calle; 04-25-2013 at 12:02 PM. Reason: Smile
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 212
Join Date: Dec 2012
Location: Frosno, Ca
Default 04-27-2013, 12:24 PM

Quote:
Originally Posted by adriana1calle View Post
I want to make some things like those, what do you reccomend? thanks!


-------------------------
casas en venta en cuenca
I'm sorry, I'm not sure what you are asking, could be more specific?
If you are having a problem with my answer, please identify where the problem is or what you don't understand.
Mark
   
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.