alice-teacher another question

Don Slater dslater at andrew.cmu.edu
Thu Nov 10 23:02:58 EST 2011


One way to do this would be to create a world level boolean variable that keeps track of which method should be called by the event. The event would have an if statement, checking the value of the boolean variable, and calling the appropriate method, and changing the value of the boolean variable with each click.

Let me know if you would like more detail…

Later,
Don Slater

On Nov 10, 2011, at 10:59 AM, Emily Higgins wrote:

> Hi All -
> Is it possible to have two different actions associated with one event?  My student wants the penguin to take one step with each pressing of the up arrow key.  In other words, the penguin would roll left with the first press, roll right with the second press.  
> 
> Thank you again for all your help.
> Emily Higgins
> Boothbay Harbor, Maine
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers



More information about the alice-teachers mailing list