<div dir="ltr"><div>Erin,</div><div><br></div><div>Alice has an expectation that scene activation listeners will do some set up and then return. Whether this is a good expectation can be discussed, but it is good to keep in mind.</div><div>The listeners are notified sequentially, so when this program is run, the first listener with a long running while loop blocks the others from being called.</div><div>In light of this, combining the activation listeners is a good idea, in part because it gives the user control over the order things run.<br></div><div><br></div><div>The tight while loops in the listeners present a further problem for the current Alice VM. There are insufficient checks in the VM and the threads it spins up, so these loops hang around, even after a user might think the program has finished.</div><div>I am testing a fix for this. Thanks you for a program that makes that testing easy.</div><div><br></div><div>Given the constraints (read bugs) of the current VM, the author of this world should be encouraged to use a more event driven approach.</div><div>Instead of looping and checking a scareActivated, call a method activateScare() where the variable is set to true and stopScaring() for false.</div><div>Similarly the repeated updating of enemyDistance could be removed and it could be updated when either one moves, or computed only when it is to be used.</div><div>These are good practices generally, but especially so until the VM bugs are fixed.</div><div><br></div><div>Thanks for highlighting these issues.</div><div><br></div><div>- Daniel Abeshouse</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 6:56 PM Donald Slater <<a href="mailto:dslater@andrew.cmu.edu">dslater@andrew.cmu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Erin,<div>Some quick suggestions after a first look:</div><div><br></div><div>Have the student try to combine the different Scene Activated listeners into one Scene Activated listener. Using Scene procedures may help him organize his thoughts.</div><div><br></div><div>I am just not quite sure how the different Scene Activated handlers all running affect the underlying system.</div><div><br></div><div>Also, the one Scene Activated method in which he is counting down (Scare Activated?) he can accomplish the same behavior in a while loop.</div><div><br></div><div>I am looking forward to other thoughts the community might have.</div><div><br></div><div>I hope that you are well.</div><div><br></div><div>All the best,</div><div>Don Slater</div><div><br></div><div>Alice Project<br><div><br><blockquote type="cite"><div>On Nov 13, 2018, at 12:44 PM, Erin Whitaker <<a href="mailto:ewhitaker@sewickley.org" target="_blank">ewhitaker@sewickley.org</a>> wrote:</div><br class="m_9194337144466655225Apple-interchange-newline"><div><div dir="ltr">I have a student project attached that it not running correctly. When you first open it, it seems to run fine, but after having it open for 5 minutes and running it a few times, it begins to run slower and slower to the point where the student can no longer run it or do any work in the coding and you have to close it out. If anyone has a few moments to see what might be causing the problem or has any suggestions, please let me know. I have opened it on several machines, mac and pc, to see if it was a computer issue, but it does the same thing on all devices. <div><br></div><div>Thanks, </div><div><br></div><div>Erin<br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_9194337144466655225gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p style="font-size:12.8000001907349px"><span style="font-family:'Gill Sans MT',sans-serif">Erin Whitaker </span><span style="font-size:10pt;font-family:'Times New Roman',serif;color:gray"> </span><span style="font-size:10pt;font-family:'Times New Roman',serif">|<span style="color:gray"> </span></span><span style="font-family:'Gill Sans MT',sans-serif"> Middle School Technology Coordinator <br></span><span style="font-size:12.8000001907349px;font-family:'Gill Sans MT',sans-serif">Sewickley Academy </span><span style="font-size:10pt;font-family:'Times New Roman',serif">|  </span><span style="font-size:12.8000001907349px;font-family:'Gill Sans MT',sans-serif">315 Academy Ave. Sewickley, PA 15143<br></span><span style="font-family:'Gill Sans MT',sans-serif;font-size:12.8000001907349px">[phone] <a href="tel:412.741.2230%20ext.%203388" value="+14127412230" style="color:rgb(17,85,204)" target="_blank">412.741.2230 ext. 3389</a> [fax] <a href="tel:412.749.5678" value="+14127495678" style="color:rgb(17,85,204)" target="_blank">412.749.5678</a></span></p><a href="http://www.sewickley.org/" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank"><span style="font-size:11pt;font-family:'Gill Sans MT',sans-serif;color:rgb(192,0,0)">web</span></a><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(192,0,0)"> </span><span style="font-size:10pt">| </span><a href="http://1838.co/1fnkI6W" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank"><span style="font-size:11pt;font-family:'Gill Sans MT',sans-serif;color:rgb(192,0,0)">blog</span></a><span style="font-size:11pt;font-family:"Gill Sans MT",sans-serif"> </span><span style="font-size:10pt">|</span><span style="font-size:11pt;font-family:"Gill Sans MT",sans-serif"> </span><a href="http://1838.co/1fnkAUZ" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank"><span style="font-size:11pt;font-family:'Gill Sans MT',sans-serif;color:rgb(192,0,0)">facebook</span></a><span style="font-size:11pt;font-family:"Gill Sans MT",sans-serif"> </span><span style="font-size:10pt">|</span><span style="font-size:11pt;font-family:"Gill Sans MT",sans-serif"> </span><a href="http://1838.co/1fnkrRt" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank"><span style="font-size:11pt;font-family:'Gill Sans MT',sans-serif;color:rgb(192,0,0)">twitter</span></a><span style="font-size:11pt;font-family:"Gill Sans MT",sans-serif"> </span><span style="font-size:10pt">|</span><span style="font-size:11pt;font-family:"Gill Sans MT",sans-serif"> </span><a href="http://1838.co/1fnkFb9" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank"><span style="font-size:11pt;font-family:'Gill Sans MT',sans-serif;color:rgb(192,0,0)">pinterest</span></a><br><p style="font-size:12.8000001907349px"><a href="http://www.sewickley.org/" style="color:rgb(17,85,204)" target="_blank"><img src="https://docs.google.com/a/sewickley.org/uc?id=0BymRGqXzE77DSXBqUTFzaGltLWM&export=download"></a></p></div></div></div></div></div></div></div></div>
<span id="m_9194337144466655225cid:f_jog0yxuc0"><Project.a3p></span>_______________________________________________<br>alice-teachers mailing list<br><a href="mailto:alice-teachers@lists.andrew.cmu.edu" target="_blank">alice-teachers@lists.andrew.cmu.edu</a><br>To change settings or unsubscribe visit:<br><a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" target="_blank">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a></div></blockquote></div><br></div></div>_______________________________________________<br>
alice-teachers mailing list<br>
<a href="mailto:alice-teachers@lists.andrew.cmu.edu" target="_blank">alice-teachers@lists.andrew.cmu.edu</a><br>
To change settings or unsubscribe visit:<br>
<a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" rel="noreferrer" target="_blank">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr">Daniel Abeshouse<div><br></div><div>Alice Project</div><div>Carnegie Mellon <span style="color:rgb(33,33,33);font-family:sans-serif;font-size:13px">University</span></div></div></div></div></div></div>