alice-teacher Random Movement problem

Don Slater dslater at andrew.cmu.edu
Wed Apr 2 14:35:46 EDT 2014


See the attached screen shot and Alice world, “mouseScurrying"…

I created a list of the 10 mice as a world variable, and used the For All together construct inside of the Loop construct.

I used a mouse turn and a mouse move command, and used the world’s random function to set the amount of the turn and the amount of the distance moved. The random… function has a “more”option for setting the min and max of the range of random values.

Then replace “mouse” in the turn and move methods with the “item from list” tile.

James is correct that if the student has an animation method for moving the legs of the mouse, they will not be able to use that method in this structure…

(Alice 3 does have similar control structures, and an animation procedural method would be usable there.)

The student may want to add appropriate checks to make sure the mice do not get too far away from or too close to the castle, but this example should give them a place to start.

Let me know if you have any questions.

All the best,
Don Slater






On Apr 2, 2014, at 1:14 PM, James Vanderhyde <jvanderhyde at benedictine.edu> wrote:

> If you’re using Alice 2, I think it will be difficult to achieve exactly what the student wants. Because Alice 2 does not support polymorphism, it will be difficult to get much advantage from putting them in a list. You would only be able to use the built-in movement methods and functions.
> 
> I think it might be better to create a few different movement actions that by themselves do not look random, but when used by 10 different objects at the same time looks like chaos. I have had students do this. Your student wants order out of the chaos, which is more difficult, but I think it could be achieved this way. For example, one mouse can move forward 6, wait 1 second, move forward 3. Another mouse can move forward 7, wait 0.8 seconds, move forward 2. Then put all the moves in a do together block.
> 
> Alice 3 may have more capability, but I haven’t used it yet.
> 
> James
> --
> Dr. James Vanderhyde
> Math and Computer Science
> Benedictine College
> jvanderhyde at benedictine.edu
> http://vanderhyde.us/~james/pro/
> 
> 
> 
> On Apr 1, 2014, at 12:05 PM, Eric Hillstrom <ehillstrom at durango.k12.co.us> wrote:
> 
>> 
>> From a student
>> 
>>  
>> Question:
>> 
>> I have taken a simple story with a medieval theme and am bringing it to life.
>> 
>> I want to have 10 mice move around in swarm/scurry fashion the world to make it look like they are protecting a castle.  How do I do this?  Should I make a list and somehow use a proximity function?  How do I make it look random in nature to simulate mice scurrying around?
>> 
>> -- 
>> 
>> 
>> 
>> 
>> 
>> 
>> Eric Hillstrom
>> Teacher, CTE/Technology
>> Durango High School
>> 970-259-1630 x2204
>> _______________________________________________
>> alice-teachers mailing list
>> alice-teachers at lists.andrew.cmu.edu
>> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
> 
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mouseScurrying.png
Type: image/png
Size: 44877 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0001.png 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0004.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mouseScurrying.a2w
Type: application/octet-stream
Size: 4417933 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0001.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0005.html 


More information about the alice-teachers mailing list