AllTheTimeWorld.com

alice eventsAlice Programming

Alice Programming

Learn Alice in FREE step-by-step lessons.

Quiz on Events: Responding to the Mouse and Keyboard

After doing all parts of the lesson you should be able to answer these questions.

Write down the answers first. Click the check to check your answer.

When an event occurs, the program will only handle the event if you have added an event ______ answer

   listener

What are some exwamples of events? answer

   mouse click, type on keyboard, timer going off, s collision

True or False: Handling events is just one way to make a program interactive. answer

   False, you can also ask the user questions and respond to them.

In additon to mouse and keyboard events what other events can occur? answer

   Alice also has event listeners for position, such as collisions, proximity, occlusion, timers and more.

The collision listener has 2 arguments. They are both ____ of objects. answer

   arrays

When you drag the mouseClicked event listener into the code there is a list of tiles to the right as shown below. What is the purpose of these tiles? answer

   They are functions that give information about the event and can be dragged into the procedure.

How do you create a listener for a collision? answer

   Select the addCollisionStartListener; Create two arrays for the things that could collide with each other; Add an if control structure to see which items collided; Add the statements that you want to execute when the collision occurs.

Please review the material for any questions you miss.