Introduction to Scratch & Coding

Introduction to the Customize Muffins Project

  • In this lesson, we will create a fun customization project using Scratch.
  • In this project, we will make muffins by clicking buttons to change the dough, flavor, and toppings.
  • This lesson helps students understand sprites, costumes, buttons, broadcast messages, layering, and alignment in Scratch.

What Students Will Learn

  • How to create multiple costumes for a sprite
  • How to duplicate sprites to make new parts
  • How to use buttons to control sprites
  • How to use broadcast messages to communicate between sprites
  • How to switch costumes using next costume
  • How to keep sprites fixed in one position
  • How to bring a sprite to the front layer for visibility
  • How to align multiple sprite parts properly

Adding and Preparing Sprites

Muffin Dough Sprite

  • Click on Choose a Sprite and add a muffin sprite
  • Rename it Muffin Dough (this will be the bottom part of the muffin)
  • Go to Costumes
  • Delete extra costumes not needed
  • Duplicate the costume 3–4 times for variations
  • Use the paint bucket tool to change dough colors

Muffin Flavor Sprite

  • Duplicate the Muffin Dough sprite and rename it Muffin Flavor
  • In Costumes, delete the bottom dough part so only the top part remains
  • Duplicate the top part 4 times to make different flavors
  • Use the paint bucket tool for colors:
    • Brown: Chocolate
    • Pink: Strawberry
    • Blue: Blueberry
    • Yellow: Lemon

Muffin Toppings Sprite

  • Duplicate the Muffin Flavor sprite and rename it Muffin Toppings
  • In Costumes, create different toppings:
    • Costume 1: Chocolate chips
    • Costume 2: Sprinkles
    • Costume 3: Frosting
    • Costume 4: Blueberries
  • Delete the background in each costume after drawing toppings

Adding Buttons

  • Add three button sprites from Choose a Sprite
  • Rename buttons: Dough, Flavor, Toppings
  • Edit the costumes of each button to display text: Dough, Flavor, Toppings
  • Explanation: These buttons will control which part of the muffin changes

Using Broadcast Messages

Changing Dough

  • On the Dough button:
    • Add when this sprite clicked
    • Add broadcast and create a message called Change Dough
  • On Muffin Dough sprite:
    • Add when I receive Change Dough
    • Add next costume from Looks
  • Explanation: Clicking the Dough button changes the dough costume

Changing Flavor

  • On the Flavor button:
    • Add when this sprite clicked
    • Broadcast a message called Change Flavor
  • On Muffin Flavor sprite:
    • Add when I receive Change Flavor
    • Add next costume

Changing Toppings

  • On the Toppings button:
    • Add when this sprite clicked
    • Broadcast a message called Change Toppings
  • On Muffin Toppings sprite:
    • Add when I receive Change Toppings
    • Add next costume

Keeping Muffin Parts in Place

  • On Muffin Dough sprite:
    • Add when green flag clicked
    • Add go to x: ___ y: ___ (set desired position on stage)
    • Wrap in forever block to keep position fixed
  • Repeat the same for Muffin Flavor and Muffin Toppings sprites

Keeping Toppings on Front

  • On Muffin Toppings sprite:
    • Add go to front layer from Looks
  • Explanation: Ensures the toppings are always visible on top of dough and flavor

Aligning Sprites

  • Make sure all costumes of dough, flavor, and toppings are properly centered in the paint editor
  • Explanation: Proper alignment ensures the muffin parts sit correctly on top of each other

Summary of What Students Learned

  • How to create and duplicate sprites
  • How to make multiple costumes for different variations
  • How to create buttons to control other sprites
  • How to use broadcast messages
  • How to switch costumes using next costume
  • How to fix sprites in one position
  • How to bring a sprite to the front layer
  • How to align costumes for correct layering

Task for Students

  • Create your own customization project:
  • Use different objects like cakes, donuts, or waffles
  • Add multiple costumes for each part
  • Use buttons and broadcast messages to control changes
  • Ensure all parts are aligned and toppings are on top
  • Make your project colorful and fun