<div dir="ltr">Don -<div> Thank you for the information, but I am trying to do this in Alice 3....  The prior email with the parameter passing and functions was helpful, but if you had a sample program from Alice 3, that would be great!</div>
<div>Emily Higgins</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 11, 2013 at 2:35 PM, Don Slater <span dir="ltr">&lt;<a href="mailto:dslater@andrew.cmu.edu" target="_blank">dslater@andrew.cmu.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">See the attached screen shot and Alice world (countClicks.a2w)<div><br></div><div>I have created a project with a t_rex and a triceratops, and I want to count when each is clicked on. I have created a variable for the t-rex and triceratops that keeps track of the number of times each is clicked on.</div>
<div><br></div><div>I have written a world method countClicks with an object parameter objectsClicked (shown in the screen shot).</div><div><br></div><div>IN the events editor, I have created a &quot;when the mouse is clicked on anything do” event. I leave &lt;anything&gt; as the possible target to trigger the event, and from the do: drop down menu, I select the world countClicks method and from the objectClicked parameter menu, I select “expressions” and “object under mouse cursor”.</div>
<div><br></div><div>I hope that this answers your question (I hope that I understood your question! ;-) )</div><div><br></div><div>Please let me know if I have misunderstood, or if you have any other questions.</div><div>
<br></div><div>All the best,</div><div>Don Slater</div><div><br></div><div><br></div><div><br></div><div></div></div><br><div style="word-wrap:break-word"><div></div></div><br><div style="word-wrap:break-word"><div></div>
<div><br></div><div><br><div><div>On Dec 11, 2013, at 11:11 AM, Emily Higgins &lt;<a href="mailto:erphiggins@gmail.com" target="_blank">erphiggins@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr">I can see how to pass a variable between the methods, but how can I pass it between an event listener and a method?  I want to, for example, keep track of number of mouse clicks during a game.  How can I do that?  I can&#39;t create a parameter in an event listener....  I think I am missing a step or a piece of understanding in figuring out how to manage this.<div>

<br></div><div>Thank you</div><div>Emily Higgins</div><div>Boothbay Region High School</div><div>Boothbay, Maine</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 11, 2013 at 1:17 PM, Don Slater <span dir="ltr">&lt;<a href="mailto:dslater@andrew.cmu.edu" target="_blank">dslater@andrew.cmu.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Alice 3 does not really support global variables in the same way as Alice 2. Alice 3 is Java-based, with a strong sense of scope for variables.<br>


<br>
It is possible to create a variable that belongs to the Scene class, that can be used by any other methods (functions and procedures) written on the Scene class. But If I am writing a method for the Penguin class, that method does not have access to the variable created in the Scene. That Scene variable must be passed as a parameter to the Penguin method that would like to use it, and a function of the Penguin class must return a value to for updating the Scene variable.<br>


<br>
Please let me know if you have any other questions.<br>
<br>
Later,<br>
Don Slater<br>
<div><div><br>
On Dec 10, 2013, at 3:04 PM, Robert Durtschi &lt;<a href="mailto:robert.durtschi@gcsu.edu" target="_blank">robert.durtschi@gcsu.edu</a>&gt; wrote:<br>
<br>
&gt; I&#39;m guessing it&#39;s the same for Alice 3; In Alice 2.x variables created as properties of the World object (top object in the object-tree) could be seen/manipulated by all other objects.<br>
&gt;<br>
&gt;<br>
&gt; Hello All -<br>
&gt; I am trying to iterate a counter in an event listener, so that if the user<br>
&gt; clicks on four objects, an action occurs.   How can I do this?  I also<br>
&gt; can&#39;t figure out how to make a global variable that can be accessed<br>
&gt; throughout the program.<br>
&gt;<br>
&gt; Emily Higgins<br>
&gt; Boothbay Region High School<br>
&gt; Boothbay Harbor, Maine<br>
&gt; -------------- next part --------------<br>
&gt; An HTML attachment was scrubbed...<br>
&gt; URL: <a href="http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20131209/98e3a033/attachment-0001.html" target="_blank">http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20131209/98e3a033/attachment-0001.html</a><br>


&gt;<br>
&gt; ------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; alice-teachers mailing list<br>
&gt; <a href="mailto:alice-teachers@lists.andrew.cmu.edu" target="_blank">alice-teachers@lists.andrew.cmu.edu</a><br>
&gt; <a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" target="_blank">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a><br>
<br>
_______________________________________________<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>
<a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" target="_blank">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a><br>
</div></div></blockquote></div><br></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><a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" target="_blank">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a><br>
</blockquote></div><br></div></div><br>_______________________________________________<br>
alice-teachers mailing list<br>
<a href="mailto:alice-teachers@lists.andrew.cmu.edu">alice-teachers@lists.andrew.cmu.edu</a><br>
<a href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" target="_blank">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers</a><br>
<br></blockquote></div><br></div>