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.