Your browser is not supported. Please upgrade your browser to one of our supported browsers. You can try viewing the page, but expect functionality to be broken.
CS in Algebra curriculum and content is being deprecated. Within the next few months, this lab will no longer be available. Please check out Bootstrap: Algebra instead. Learn More.
Hi, I'm Katie! One of the most exciting things about computer science is that a computer program can be interactive.
Any time somebody clicks or taps or types on a computer or phone, that generates an EVENT, and there's some code that decides what to do when an EVENT occurs.
For example, you could have an EVENT-HANDLER that says "when the mouse is clicked, play a sound"
Have you ever heard of the game FlappyBird? By using Event handlers, we're going to learn to program our own custom version of FlappyBird!
The code you'll write involves dragging and dropping blocks that represent commands for the computer. Under the hood, each of these blocks is represented by real code.
If you take a look at the workspace, there are some green blocks that are filled in for you - these are "event handlers"
If you want the bird to FLAP when you CLICK the mouse, you can do that by attaching the "FLAP" block to the appropriate event handler, and now in your game whenever you click the mouse, the bird will flap.
In each puzzle of this activity we'll introduce new types of events as green blocks on the workspace, and you can decide the appropriate blocks to add in response to those events.
When you see a drop down arrow like this, that means you can change the settings - like what sound to play when flappy hits the ground.
In the final puzzle you'll be able to create your own game and share it with your friends. Have fun!