alice-teacher Aik

Don Slater don at alice.org
Tue Mar 5 07:13:48 EST 2019


James,
Your world is interesting… When I built a project myself, before looking at your world, I did it with a do-together and the two moves (bunny and chicken) inside the block. Both moves had the same duration. When I ran it the chicken moved, and the bunny moved along an arc, chasing the chicken, what I assume to be the original distance of the chicken to the bunny. This made some sense to me, as the calculation of the distance in the function would be a one-time occurrence, but the concurrent moves would force some adjustment of the bunny’s path.

However, still in my world, when I adjusted the duration of the chicken move in the do-together, I saw exactly the same behavior as you illustrate in your example. An event, as I am sure you know, executes concurrently with whatever is in my first method; so our projects are very similar. The different duration periods certainly affects the behavior, but I will leave it to the support team to figure that out / explain it.

As a work around I did find that if I modified your bunny move event by adding a 

	while (distance to bunny > 0.01)
		bunny move (bunny distance to chicken) toward chicken (style abruptly)

I got the behavior that I think you were looking for…

Thank you for pointing this out.

All the best,
Don Slater

Alice Project

> On Mar 4, 2019, at 1:26 PM, Vanderhyde, James <vanderhyde at sxu.edu> wrote:
> 
> I am experiencing what I think is a bug in Alice 2 in the “move toward” instruction. See attachment. Here is the code:
>   bunny move ( bunny distance to chicken ) toward target = chicken
> This should move the bunny right onto the chicken, and it does, unless the chicken is moving. When the chicken is moving, even if it’s moving very slowly, the bunny does not move far enough. It should do the same thing as “bunny move to chicken,” but it doesn’t.
> 
> I am guessing there is special logic in the implementation of “move toward” for when the target object is moving, and there is an error in the calculation in that case. I am guessing maybe a unit vector is used instead of a vector scaled by the speed.
> 
> James
>> James Vanderhyde
> Assistant Professor and Department Chair, Computer Science
> Saint Xavier University
> 3700 W. 103rd St.
> Chicago, IL 60655
> 773-298-3454
> <bunny move toward chicken.a2w>_______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> 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/20190305/94ecea86/attachment.html>


More information about the alice-teachers mailing list