[Lesson 2] Get Start Scratch
2.1 About Scratch
Scratch is an online coding language and development environment that allows users to create interactive stories, games, animations, and multimedia projects. It is a free and open-source software that runs on Windows, Mac, and Linux operating systems.
2.1.1 Learn Scratch
- To learn what is scratch, please view: Introduce scratch
- If you have no experience of Scratch, please start fromGet start of scratch tutorial
- More scratch tutorial on “Collection of Coding Cards”
2.1.2 Scratch practices
10 blocks will help you to start with scratch. You can view the pdf file and practice it.
2.2 Control and condition
In Scratch, control and condition are used to make the program to make decision or to repeat the same action multiple times.
2.2.1 Loop
- repeat
- when you need do the same actions multiple times
- forever
- when you want repeat do something endless
- use wait to slow down the loop
- use ‘say’ or ‘think’ block to display the loop
2.2.2 Condition
-
condition loop : repeat until
-
use “wait until” to pause the forever with condition
-
stop the forever loop
2.2.3 Practice Loop and Condition
Let’s practice using loops and conditions in Scratch to make the Cat sprite do fun things!
Practice Task
- Spinning Cat: When you press the mouse key, the Cat on the stage will keep spinning.
- Changing Costumes: When you release the mouse key, the Cat will show a new costume every 1 second.
How to Do It
- Spinning Cat:
- Drag an “if” block into the scripting area.
- Inside the “if” block, add a “mouse down?” block to check if the mouse key is pressed.
- Add a “forever” block and put a “turn 15 degrees” block inside it.
- This will make the Cat spin continuously when the mouse key is pressed.
- Changing Costumes:
- Drag another “if” block into the scripting area.
- Inside this “if” block, add a “mouse up?” block to check if the mouse key is released.
- Add a “wait 1 second” block and a “next costume” block inside the “if” block.
- This will make the Cat show a new costume every second when the mouse key is released.
2.3 Animation in Scratch
2.3.1 Animation with Sprite from Library
- Sprite: Next Costume:
- Drag a “next costume” block into the scripting area.
- Change the sprite’s costume to create simple animations.
- FPS: Frame per Second:
- Scratch can show up to 30 frames per second (FPS).
- Use this code to find out the FPS of Scratch:
2.3.2 Drawing your costume
- Draw Your Own Costume:
-
Use the drawing tools in Scratch to create your own costumes.
- Convert Between Vector and Bitmap:
- Bitmaps and vectors are two different types of graphics.
- Vector Graphics: Use mathematical formulas to draw lines and curves.
- Bitmap Graphics: Store the color of each pixel.
- the different of Vector and Bitmap
2.3.3 Animation with code
- Moving by change location
- Use code to move your sprite around the stage.
- Turn around
- Make your sprite turn in different directions.
- Glide
- Make your sprite move smoothly.
- Change color and other graphic effect
- Use code to change the color and other graphic effect of your sprite.
- Change size
- Use code to change the size of your sprite.
2.4 Scratch practices and project
2.4.1 Practices
- Simple animation in sprit Build A Band
- Animation with Drawing Orange Square Purple Circle
- Animation It’s alive
- Animation with music Music video
2.4.1 Project of this class
- Base on the about me
- Build a Scratch project to introduce yourself.
- Make sure need use all different types of Animation in scratch
- Make sure use Condition and loop in you project