alice-teacher looking for some info

Karen kgayowsky1 at gmail.com
Fri Nov 11 11:25:19 EST 2011


Thanks all for the responses... I will have the students check them out
today!  What a great forum this is.

Karen Gayowsky
ICS Teacher
St. Anne's High School

On Fri, Nov 11, 2011 at 11:09 AM, James Vanderhyde <
jvanderhyde at benedictine.edu> wrote:

>  OK, then, I will assume that the student has an event that calls some
> method when the up key is typed. Within the method, instead of simply
> moving forward, put the code to move forward inside an IF block. The
> condition on the IF will check the distance to the bush, and only allow the
> forward movement if the distance is greater than a certain amount. (Dr.
> Slater just posted some instructions to help with the distance check.)
>
> This will work for one bush. If you have several bushes, you need a
> similar condition for each bush, and you can connect them with an AND.
>
> This will quickly get tedious for more than 2 or 3 bushes, so a better
> approach would be to write a function that loops through a list of bushes
> and checks the distance to each one. The function returns true if the
> distance in front of the girl object is clear of objects.
>
>
> James
> --
> Dr. James Vanderhyde
> Math and Computer Science
> Benedictine College
> jvanderhyde at benedictine.edu
> http://vanderhyde.us/~james/pro/
>
>
>
> On 11/11/11 9:58 AM, "Karen" <kgayowsky1 at gmail.com> wrote:
>
> Thank you for your reply Dr. Vanderhyde.
>
> The students are just now writing events and event handling methods.  I
> believe she is using the arrows up and down to control the walking of her
> object, but she wants the girl to be stopped and not be allowed to even by
> accident to go through the bushes.
>
> Thanks for any suggestions
>
> Karen Gayowsky
> ICS Teacher
> St. Anne's High School
>
> On Fri, Nov 11, 2011 at 10:37 AM, James Vanderhyde <
> jvanderhyde at benedictine.edu> wrote:
>
> This is a bitt difficult, and there are many ways to do it. The topic is
> called "collision detection." My students have implemented it several
> different ways, but none has been completely satisfactory.
>
> How is the girl object controlled? This is important to figuring out the
> best way to handle collisions.
>
> James
> --
> Dr. James Vanderhyde
> Math and Computer Science
> Benedictine College
> jvanderhyde at benedictine.edu <http://jvanderhyde@benedictine.edu>
> http://vanderhyde.us/~james/pro/ <http://vanderhyde.us/%7Ejames/pro/>
>
>
>
>
> On 11/10/11 1:45 PM, "Karen" <kgayowsky1 at gmail.com <
> http://kgayowsky1@gmail.com> > wrote:
>
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20111111/46b61447/attachment.html 


More information about the alice-teachers mailing list