Scratch Programming - Notes
📌 What is Scratch?
Scratch is a block-based visual programming language developed by MIT.
It is designed to help beginners (especially children) learn the concepts of
programming through drag-and-drop blocks.
Projects can include animations, games, interactive stories, and more.
🧱 Scratch Interface Overview
1. Stage – Area where the action happens.
2. Sprites – Characters or objects that perform actions.
3. Script Area – Where you drag blocks to create code.
4. Blocks Palette – Contains different code blocks (organized by category).
5. Backdrop – Background of the stage.
🧩 Types of Code Blocks in Scratch
Category Color Purpose
Motion Blue Move sprites, rotate, change position
Looks Purple Change costumes, show/hide, say/think
Sound Pink Play sounds, change volume
Events Yellow Start scripts (e.g., when green flag clicked)
Control Orange Loops, wait, if-else conditions
Sensing Light Blue Detect input (e.g., key press, touching)
Operators Green Math, comparisons, join text
Variables Dark Orange Store and change values
My Blocks Red Create custom blocks (functions)
🔁 Important Programming Concepts in Scratch
Concept Scratch Equivalent
Sequence Ordering blocks in a script
Loops repeat, forever blocks
Conditionals if, if-else blocks
Variables Use to store scores, timers, etc.
Events when green flag clicked, broadcast
Functions Created using My Blocks
🎮 Making a Simple Scratch Game
Example: Catch the Apple Game
1. Add a Basket Sprite and an Apple Sprite.
2. Move the basket using arrow keys (when key pressed → change x).
3. Make the apple fall (change y by -5 inside a forever loop).
4. Use if touching basket → increase score.
5. Reset apple position after it's caught or missed.
💡 Tips for Beginners
Always start with the “When Green Flag Clicked” block.
Use costumes to animate characters.
Use broadcast messages to coordinate between sprites.
Test your code often!
Organize your scripts into sections to make them easier to read.
🧠 Benefits of Scratch
Develops logical thinking and problem-solving skills.
Encourages creativity and collaboration.
Builds confidence in programming from an early age.
📚 Useful Scratch Terms
Sprite: Object in the project (like a character).
Costume: Different appearances for a sprite.
Backdrop: The background of the stage.
Script: Set of code blocks.
Broadcast: A way to send messages between sprites.