alice-teacher Project Help

Daniel Abeshouse dabeshou at andrew.cmu.edu
Thu Nov 29 11:56:27 EST 2018


Erin,

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.
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.
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.

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.
I am testing a fix for this. Thanks you for a program that makes that
testing easy.

Given the constraints (read bugs) of the current VM, the author of this
world should be encouraged to use a more event driven approach.
Instead of looping and checking a scareActivated, call a method
activateScare() where the variable is set to true and stopScaring() for
false.
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.
These are good practices generally, but especially so until the VM bugs are
fixed.

Thanks for highlighting these issues.

- Daniel Abeshouse

On Tue, Nov 13, 2018 at 6:56 PM Donald Slater <dslater at andrew.cmu.edu>
wrote:

> Erin,
> Some quick suggestions after a first look:
>
> 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.
>
> I am just not quite sure how the different Scene Activated handlers all
> running affect the underlying system.
>
> Also, the one Scene Activated method in which he is counting down (Scare
> Activated?) he can accomplish the same behavior in a while loop.
>
> I am looking forward to other thoughts the community might have.
>
> I hope that you are well.
>
> All the best,
> Don Slater
>
> Alice Project
>
> On Nov 13, 2018, at 12:44 PM, Erin Whitaker <ewhitaker at sewickley.org>
> wrote:
>
> 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.
>
> Thanks,
>
> Erin
>
> --
>
> Erin Whitaker  |  Middle School Technology Coordinator
> Sewickley Academy |  315 Academy Ave. Sewickley, PA 15143
> [phone] 412.741.2230 ext. 3389 <412.741.2230%20ext.%203388> [fax]
> 412.749.5678
> web <http://www.sewickley.org/> | blog <http://1838.co/1fnkI6W> | facebook
> <http://1838.co/1fnkAUZ> | twitter <http://1838.co/1fnkrRt> | pinterest
> <http://1838.co/1fnkFb9>
>
> <http://www.sewickley.org/>
> <Project.a3p>_______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
>
>
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers



-- 

Daniel Abeshouse

Alice Project
Carnegie Mellon University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20181129/84c2e432/attachment.html>


More information about the alice-teachers mailing list