alice-teacher looking for some info

Don Slater dslater at andrew.cmu.edu
Fri Nov 11 10:50:38 EST 2011


This will require the use of the built-in functions and / or writing an arithmetic expression.

There are built-in functions for objects that include getDistanceTo, getDistanceInFrontOf, getDistanceToThe RightOf, etc, available when you select an object in the object tree, and then click on the functions tab…

See the attached world ("AliceMovesToBush")

I have Alice turn to face the bush, and the bush to turn to face Alice (in this way I now know the orientation of the bush)

I then have Alice move forward the distance to the front of the bush.

If the bush was not facing Alice, I would then have to try Alice distance to the right of the bush, or to the left of the bush, or behind the bush (depending on which way the bush was facing in relationship to Alice.

See the statement that has been disabled. This statement will work, and I do not have to worry about the orientation of the bush. the distanceTo function measures center point to center point. So Alice move forward (the distanceTo the bush) would put Alice in the middle of the bush.

So I have Alice move forward (the distance to the bush - (½ the depth of the bush + ½ the depth of Alice))

I do not know if you interested in exploring arithmetic expressions and functions with your students using Alice, but this is actually a very good exercise for them to work on.

Let me know if you have any other questions.

Later,
Don Slater
 
On Nov 11, 2011, at 6:34 AM, Karen wrote:

> <
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AliceMovesToBush.a2w
Type: application/octet-stream
Size: 532197 bytes
Desc: not available
Url : https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20111111/c2aa6b17/attachment-0001.obj 
-------------- next part --------------
> snip>
> 
> ---------- Forwarded message ----------
> From: Karen <kgayowsky1 at gmail.com>
> Date: Thu, Nov 10, 2011 at 2:45 PM
> Subject: looking for some info
> To: Alice educators <alice-teachers at lists.andrew.cmu.edu>
> 
> 
> Hello All:
> A student of mine is trying to have her object (girl) stop instead of going through objects (bushes).  
> Can anyone help with that code?  She does not want the object to be able to go through another wall type object.
> Thanks in advance for any info
> 
> Karen
> 
> -- 
> This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed.    If you are not the intended recipient, you are notified herein that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender and erase this e-mail message immediately.  Your cooperation is appreciated.
> 
> 
> 
> -- 
> This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed.    If you are not the intended recipient, you are notified herein that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify the sender and erase this e-mail message immediately.  Your cooperation is appreciated.



More information about the alice-teachers mailing list