O'Reilly logo

Scratch™ 2.0 Sams Teach Yourself in 24 Hours by Timothy L. Warner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hour 8. Using Event Blocks

Scratch 2.0 is an example of an event-driven programming language. In event-driven programming, your computer program’s flow is determined by the occurrence and handling of events.

What is an event? For our purposes, and event is either a digital user action such as a mouse click or keyboard press, or an analog sensor input, such as a volume or light change.

Event blocks in Scratch 2.0 are absolutely crucial to the success of our program. In point of fact, our scripts simply won’t run without at least one event block-the image block.

Understanding Event Blocks

As you can see in Table 8.1, the Events palette in Scratch 2.0 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required