alice-teacher Question about move toward

Donald Slater djslater107 at mac.com
Fri Feb 10 11:19:11 EST 2017


Jim,
If I understand your question correctly, the student would like the chicken to spin on its own axis while moving toward the bunny, much as the same way the moon would rotate while revolving round the earth (the difference being that the chicken is not orbiting the bunny but moving toward it).

I am not sure that this is a bug, but it is certainly a side-effect of the implementation. I notice that if the chicken moves to the bunny, you do get the behavior I described above. move to  is an absolute command as that essentially Alice is setting the center point of the object to the center point of the target, and then animating that movement. 

The idea of move toward, was to provide a way to have one object approach another without colliding with it. Like move, iit is a relational action, using the object's orientation to determine the animation. And in this do together, as you know, that orientation is always changing creating the spinning, just as would happen with a  move.

The solution is to use a different point of view, or orientation, to determine the path of the move toward. In the code snippet I have attached, you will see that I am using the as seen by modifier to tell the chicken to move toward the bunny as seen by the ground. (It turns out that I could also have said as seen by the bunny).

I believe that this is generating the behavior your student was looking for.

I have to tell you, you and your students always come up with interesting questions, and I enjoy wrestling with them.

Let me know if I misunderstood or if there are any other questions…



All the best,
Don Slater

Alice Project
Carnegie Mellon University
Entertainment Technology Center
700 Technology Drive
Pittsburgh, PA 15219

Email: dslater at cmu.edu

I have learned this at least by my experiment: that if one advances confidently in the direction of his dreams, and endeavors to live the life he has imagined, he will meet with a success unexpected in common hours.
--- Henry David Thoreau

The true object of all human life is play. -- G.K. Chesterton


> On Feb 9, 2017, at 4:22 PM, Vanderhyde, James via alice-teachers <alice-teachers at lists.andrew.cmu.edu> wrote:
> 
> I am using Alice 2.4.3. One of my students today produced unexpected behavior using “move toward.” Consider this code:
> 
>  Do together
>  	  chicken turn left 1 revolution
>   chicken move amount = 2 meters toward target = bunny
> 
> The chicken turns in a circle rather than turning while moving toward the bunny. I know that “move forward” combined with “turn left” will result in circular movement. But I don’t understand why “move toward” is doing it. After all, “move toward” by itself works no matter which way the chicken is facing.
> 
> Is this a bug or desired behavior? If desired, can someone explain it to me?
> 
> James
>> James Vanderhyde
> Assistant Professor, Computer Science
> Program Director, Master of Applied Computer Science
> Saint Xavier University
> 3700 W. 103rd St.
> Chicago, IL 60655
> 773-298-3454
> 
> _______________________________________________
> 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/20170210/cd4775a0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotating chicken.png
Type: image/png
Size: 44078 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170210/cd4775a0/attachment-0001.png>


More information about the alice-teachers mailing list