Alice Community How do I make things move at Random

 How do I make things move at Random
 Jackweird Junior Member   Status: Offline Posts: 1 Join Date: Apr 2013 How do I make things move at Random - 04-20-2013, 08: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
 Go west young man :)
chickentree
Super Moderator

Status: Offline
Posts: 249
Join Date: Dec 2012
Location: Frosno, Ca
Go west young man :) - 04-21-2013, 12:46 PM

Quote:
 Originally Posted by Jackweird 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

 Help
 adriana1calle Guest   Status: Posts: n/a Help - 04-23-2013, 01: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 11:02 AM. Reason: Smile
chickentree
Super Moderator

Status: Offline
Posts: 249
Join Date: Dec 2012
Location: Frosno, Ca
04-27-2013, 11:24 AM

Quote:
 Originally Posted by adriana1calle 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

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge