Events & Methods

A programming design technique is to create methods.  Methods are used when you find yourself repeating code.  Instead of repeating code, you simply add the code once into a method and then you can call that method whenever you need it.

Your programs can also listen (detect) for user-input through the use of Events.  In Alice there are a range of Events your animation can listen for.  Common events are when the World starts, an object is clicked on using the mouse and a key is pressed on your keyboard.

Here is the one-page handout I created for resizing objects, creating methods and using Events in Alice.

This is the brief example I created this morning.  Unfortunately the sound did not work when I exported the file.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s