What Is an Event?
An event is a trigger — something that starts an action. Clicking a button, pressing a key, moving the mouse — these are all events.
When the event happens, your code responds!
Event Handlers
An event handler is the code that runs when an event happens. For example: "When the button is clicked → play a sound." The event is "click"; the handler is "play a sound."
💡
Events in games!
When you press right arrow → character moves right. When you collect a coin → score goes up. Events make games fun!
Events Make Programs Interactive!
Without events, programs just run from top to bottom once. With events, your program can respond to what you do! That makes it alive!