<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>An Introduction to Alice 2.2 by Charles W. Herbert has a nice piece of code in Chapter 10</p>
<p><br>
</p>
<p>Basically you set up a "While the world is running" event that calls your collision detection method.</p>
<p>In that particular chapter there is a penguin that can fall through a hole, collide with a snowbank, or reach a flag (Victory!)</p>
<p>Basically the detection code checks each "goal" in turn. <br>
</p>
<p>For the list of holes:</p>
<p>    for all the holes together</p>
<p>       If penguin is within 1 meter of hole  (where the holes are 1 meter radius)</p>
<p>            penguin move down 5 meters<br>
            etc.</p>
<p>For the snowbank which is defined as a 10.5 meter circle with center at the middle</p>
<p>      if penguin is at least 10.5 meters away from snowbank </p>
<p>         penguin move toward snowbank 0.25 meters</p>
<p>         etc<br>
</p>
for the flagpole<br>
    if penguin distance to flagpole <= 1 meter<br>
        do victory stuff.<br>
<br>
where the if parts are the first 3 items in the penguin's function tab.<br>
<br>
Hope this helps<br>
You can email me at robert.durtschi@gcsu.edu if you have any further questions<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div class="PlainText"><br>
From: alice-teachers <alice-teachers-bounces+mrgrog=outlook.com@lists.andrew.cmu.edu> on behalf of Nichols, Denise via alice-teachers <alice-teachers@lists.andrew.cmu.edu><br>
Sent: Wednesday, November 9, 2016 10:08 AM<br>
To: alice-teachers@lists.andrew.cmu.edu<br>
Subject: alice-teacher Collision Detection in Alice 2<br>
<br>
Hello all,<br>
Next month, I am hoping to have my class to the point where they can make simple games in Alice 2.  However, last year, we had a lot of trouble with collision detection in Alice 2.4.  Does anyone have any suggestions and/or materials for covering this topic?<br>
Denise Nichols<br>
Computer Teacher<br>
York Catholic High School<br>
dnichols@yorkcatholic.org<mailto:dnichols@yorkcatholic.org><br>
717-846-8871<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20161110/1f4dc1c4/attachment-0001.html" id="LPlnk599178" previewremoved="true">http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20161110/1f4dc1c4/attachment-0001.html</a>><br>
<br>
<br>
End of alice-teachers Digest, Vol 74, Issue 5<br>
*********************************************<br>
</div>
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>F</b></font></div>
</div>
<font size="2"><span style="font-size:10pt;"></span></font></div>
</div>
</body>
</html>