alice-teacher A2 movement of objects Re: s Digest, Vol 45, Issue 3

James Vanderhyde jvanderhyde at benedictine.edu
Thu Apr 3 13:36:22 EDT 2014


I can think of a few different ways to do this, but I think the best way is as follows:
Put all the objects into 1 list.
Position them in the world where you want them to start.
If you put “Move forward” and “Turn 1 revolution” in a Do Together block, the object will travel in a circle.
The amount to move forward is the circumference of the circle. The circumference can be calculated using the formula C=2πr. The value for r is the radius, and this can be calculated in Alice using the distanceTo function. The radius is the distance of each object to an object in the center of the moat (the castle?)

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu<mailto:jvanderhyde at benedictine.edu>
http://vanderhyde.us/~james/pro/



On Apr 2, 2014, at 2:10 PM, Marilynn Huret <mhuret at mindspring.com<mailto:mhuret at mindspring.com>> wrote:

in Alice 2



an easy way is to make a list with 2-3 objects moving at a specific rate.around the most



then make another list with 2-3 addition objects moving at a different rate and make as many lists as you need.
Having them start in different places, and all run at the same time will give the illusion of organized circling of the moat, each list moving at a different speed



-=marilynn huret=-



-----Original Message-----
>From: alice-teachers-request at lists.andrew.cmu.edu<mailto:alice-teachers-request at lists.andrew.cmu.edu>
>Sent: Apr 2, 2014 2:35 PM
>To: alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
>Subject: alice-teachers Digest, Vol 45, Issue 3
>
>Send alice-teachers mailing list submissions to
> alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
>
>To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
>or, via email, send a message with subject or body 'help' to
> alice-teachers-request at lists.andrew.cmu.edu<mailto:alice-teachers-request at lists.andrew.cmu.edu>
>
>You can reach the person managing the list at
> alice-teachers-owner at lists.andrew.cmu.edu<mailto:alice-teachers-owner at lists.andrew.cmu.edu>
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of alice-teachers digest..."
>
>
>Today's Topics:
>
> 1. Re: Random Movement problem (James Vanderhyde)
> 2. Re: Random Movement problem (Don Slater)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Wed, 2 Apr 2014 17:14:51 0000
>From: James Vanderhyde
>Subject: Re: alice-teacher Random Movement problem
>To: Alice educators , Eric
> Hillstrom
>Message-ID: <89E55CD5-BA2F-4C38-8EF9-26368AA34A29 at benedictine.edu<mailto:89E55CD5-BA2F-4C38-8EF9-26368AA34A29 at benedictine.edu>>
>Content-Type: text/plain; charset="windows-1252"
>
>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<mailto:jvanderhyde at benedictine.edu>
>http://vanderhyde.us/~james/pro/
>
>
>
>On Apr 1, 2014, at 12:05 PM, Eric Hillstrom > 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<mailto: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/9932b947/attachment-0001.html
>
>------------------------------
>
>Message: 2
>Date: Wed, 2 Apr 2014 14:35:46 -0400
>From: Don Slater
>Subject: Re: alice-teacher Random Movement problem
>To: Alice Teachers
>Message-ID: <5B233908-FE00-4D14-BD0F-2786E121EDCB at andrew.cmu.edu<mailto:5B233908-FE00-4D14-BD0F-2786E121EDCB at andrew.cmu.edu>>
>Content-Type: text/plain; charset="windows-1252"
>
>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 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<mailto:jvanderhyde at benedictine.edu>
>> http://vanderhyde.us/~james/pro/
>>
>>
>>
>> On Apr 1, 2014, at 12:05 PM, Eric Hillstrom 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<mailto: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<mailto: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.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.png
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0001.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.obj
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20140402/66ab9f3d/attachment-0002.html
>
>------------------------------
>
>_______________________________________________
>alice-teachers mailing list
>alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
>https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
>
>
>End of alice-teachers Digest, Vol 45, Issue 3
>*********************************************
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto: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/20140403/32c11c92/attachment.html 


More information about the alice-teachers mailing list