Custom Blocks

0
0
Profile picture of sarah.chapa

sarah.chapa

Updated 5 months ago

1. Slide
300 seconds
In Scratch
Custom Blocks
2. Slide
60 seconds
We will: examine reasons for using custom blocks and enhance code by using custom blocks. I will: write my own custom block.
Lesson Objectives
3. Poll
20 seconds
How comfortable do you feel with creating and using custom blocks in Scratch?
  • I can teach it
  • I can do it
  • I need some help
4. Slide
60 seconds
Custom blocks in Scratch are called functions, methods, sub-programs, or procedures in other programming languages. Custom blocks allow you to store a chunk of code together that serves a certain purpose.
What is a custom block?
5. Slide
60 seconds
You can use a custom block to: Reduce lines of code by storing repeated code in a custom block Organize code in a meaningful way that makes it easier to read
What is a custom block?
6. Slide
60 seconds
We first define a custom block, then we call the custom block as many times as we want in our main code.
Example 1
7. Slide
60 seconds
This custom block has a numerical input (also called parameter) for the height. Height is now used like a variable.
Example 2
8. Slide
60 seconds
1) look over the code 2) discuss with your partner where a function may be useful 3) share with class
Think Pair Share 1
9. Slide
60 seconds
1) look over the code 2) discuss with your partner where a function may be useful 3) share with class
Think Pair Share 2
10. Slide
60 seconds
Create a simple program using a custom block that makes the sprite rotate 360 degrees. Can you extend it by using an input?
You Try!
11. Open question
120 seconds
What is one reason why you might use a custom block in Scratch?
12. Poll
30 seconds
How confident are you with today's lesson?
  • Very confident 💪🏻
  • Somewhat confident 😊
  • Neutral 🤷🏻‍♂️
  • Not very confident 😕
  • No confidence at all 🙁

Suggested content