The clock on the wall of the house is ticking, and there are hour, minute and second hands inside. In the clock dial, the second hand completes one circle every 60 seconds, that is, the minimum angle of the second hand is 360/60 = 6°; the minute hand completes one cycle every 60 minutes, that is, the minimum angle of the minute hand is 360/60 = 6°; After 12 hours, after one week, the minimum angle of the instant needle is 360/12 = 30°.
The following is an introduction to drawing a dynamic clock in Scratch.
1. Define the "dial" building block
2. Define the "tick mark" building block
3. Define 3 roles
3.1 The role of the second hand
- Click Scratch --> select a character --> draw --> shape --> line segment
- Manually draw a horizontal straight second hand in Scratch;
- Let its left end coincide with the center point of the canvas;
- The line width is 8, and the color is red, as shown in Figure (5);
- Define the movement code of the second hand, as shown in Figure (6).
3.2 Minute hand role
- Click Scratch --> select a character --> draw --> shape --> line segment
- Manually draw a horizontal straight minute hand in Scratch;
- Let its left end coincide with the center point of the canvas;
- The line width is 8, and the color is light yellow, as shown in Figure (7);
- Define the movement code of the minute hand, as shown in Figure (8).
3.3 Hour hand role
- Click Scratch --> select a character --> draw --> shape --> line segment
- Manually draw a horizontal straight hour hand in Scratch;
- Let its left end coincide with the center point of the canvas;
- The line width is 12 and the color is dark yellow, as shown in Figure (9);
- Define the movement code of the hour hand, as shown in Figure (10).
4. Define the angle variable
Click [Variable] on the left side of Scratch --> Create a variable --> Angle
5. Main function
The effect is as follows: