WEBVTT 00:00:00.390 --> 00:00:01.300 Hi everyone, 00:00:01.300 --> 00:00:06.852 One of the most exiting things of a program is that it can be interactive. 00:00:06.852 --> 00:00:12.441 Any time someone clicks, tabs or types something at a computer or phone, that generates a event. 00:00:12.441 --> 00:00:16.428 and there is some code that decides what to do when an event occurs. 00:00:16.428 --> 00:00:20.063 For example, you could have an eventhandler that sais 00:00:20.063 --> 00:00:22.272 "when the mouse is clicked, play a sound". 00:00:23.582 --> 00:00:25.657 Let's try an activity to see how it works. 00:00:25.657 --> 00:00:28.261 Have you ever heard of the game Flappy Bird? 00:00:28.261 --> 00:00:34.499 By using eventhandlers, you can learn how to program your very own custom version of Flappy Bird. 00:00:34.499 --> 00:00:40.801 The code you write involves dragging and dropping blocks, that represents commands for the computer. 00:00:40.801 --> 00:00:44.061 Drag and drop programming is the easiest way to learn... 00:00:44.061 --> 00:00:47.062 It's even how university students learn how to code. 00:00:47.062 --> 00:00:51.011 But under the hood, each block is represented by real code. 00:00:51.011 --> 00:00:56.059 If you take a look at the workspace, there are some green blocks that are filled in for you. 00:00:56.059 --> 00:00:57.871 These are event handlers. 00:00:57.871 --> 00:01:04.820 If you want the bird to flap, when you click your mouse, you can do this by attaching the flap-block to the appropriate eventhandler. 00:01:04.820 --> 00:01:08.714 And now in your game, whenever you click your mouse, the bird will flap. 00:01:08.714 --> 00:01:15.413 In each puzzle of this activity, we will introduce new types of events as green blocks on the work space. 00:01:15.413 --> 00:01:19.506 and you can decide the appropriate block to add in responds of these events. 00:01:19.506 --> 00:01:23.620 When you see a arrow like this, you can change the settings, 00:01:23.620 --> 00:01:26.620 like the sound to play when the bird touches the ground. 00:01:26.620 --> 00:01:31.318 In the final puzzle, you will be able to create your own game and share it with your friends. 00:01:31.318 --> 00:01:33.224 Have fun!