alice-teacher Proximity problem

Don Slater dslater at andrew.cmu.edu
Thu Nov 17 08:41:05 EST 2011


The problem is that distance in Alice is measured from center point to center point of the two objects. So that if the center point of the sward is in the handle, and the center point for the troll is at the troll's feet, than .07 meters is probably not going to be close enough…

A suggestion… Create a circle object (from the shapes gallery) size it appropriately, place it on the troll as if the troll was wearing a target. Set the vehicle property of this circle to the troll, and the isShowing property of the circle to false, and so you now have an invisible target on (or even inside the troll if you wish), and you now measure from the sword to the center point of the circle.

Let me know if you have any other questions.

Later,
Don Slater

On Nov 17, 2011, at 1:22 AM, dorlik at wildwood.org wrote:

> My student is trying to build a game in which the player slays trolls with a sword. It seemed like a simple "if sword is within ,07 meters of troll" "do together Health cube showing is false"
> However, we cannot get it to work. Nothing changes when the player slashes the troll with the sword Suggestions? 
> 
> Sent from my very cool iPhone
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
> 



More information about the alice-teachers mailing list