April 28, 2025

Week 31 - Block programming with Scratch

CLASS OBJECTIVE

Introduce block-based programming by creating a Scratch account and exploring its key features, such as sprites, stages, events, controls, motion, sounds, appearances, and more.


INTRODUCTION

BLOCK-BASED PROGRAMMING

In this course you learned to program using different programming styles, like flowcharts (Raptor) and a didactic programming language (PseInt). Now you'll be introduced to block-based programming.

Block-based programming is a way of programming that uses visual blocks instead of writing code with text. These blocks fit together like puzzle pieces, making it easier to understand programming logic without needing to memorize syntax. It is very common in educational environments, such as Scratch, Blockly, or App Inventor, because it helps beginners (especially children and young people) learn the basic concepts of programming.

  • Sequences
  • Conditionals
  • Loops
  • Variables
  • Events

Each block represents an instruction or control structure, and by dragging and connecting them, the program is built.


Events

In block-based programming, an event is an action or situation that triggers or activates a block of code. In other words, the program starts executing certain instructions when that event occurs.


Control

These are the blocks that manage the flow of the program. They can easily be compared to traditional programming structures such as decision-making and loops, among others.


Stage and Objects

Programming in Scratch is often compared to animation, whether pre-programmed or interactive with a user. To achieve this, it is necessary to have a background (stage) and objects (sprite) that perform movements, change appearance, or play sounds.


Movement, Sounds, and Looks

These are essentially the actions that objects will perform when the conditions are met, or when the user decides.


Variables

As in any programming environment, the need to store data requires the use of variables, which are memory spaces labeled to store information related to the execution of a program.


Operators

Like variables, mathematical, text, and comparison operators are necessary for the execution of programs. With them, we can analyze and compare numerical information required for the execution of a program, even in a graphical environment.


SCRATCH ACCOUNT

Before you can star using Scratch, you have create an account in the next Web Address.

https://scratch.mit.edu/

Once in, follow the next steps:

  1. Click on the "Join Scratch" button.
  2. Create your user name using your student number, name and second name. 12345JosePerez
  3. Select México from the list.
  4. Add your birth month and year.
  5. Now your gender
  6. Write your school email address. a12345@idec.edu.mx
  7. Validate the process by opening your email account
Now, you're ready to start using Scratch. Use the CREATE menú to start programming.





Now, follow your teacher instructions to create your first program.


CLASS NOTES

As usual, write down the class title, the class objective, and answer the following questions:

  1. What are the differences between the Raptor, PseInt, and Scratch programming styles?
  2. Can you name at least three elements used in Raptor, PseInt, and Scratch?
  3. What is completely new to you in Scratch?