当前位置:网站首页>[programming problem] [scratch Level 2] March 2019 draw a square spiral

[programming problem] [scratch Level 2] March 2019 draw a square spiral

2022-07-07 23:56:00 Youth programming competition communication

Draw a square spiral

Square spiral is a common spiral shape , Its characteristic is that the length of continuous line segments increases uniformly , For example, the length of the first line segment is 5, The second length is 10, The third length is 15, And so on .

Now please write a program to realize the pattern effect in the figure below :

When the green flag is clicked , Starting from the center of the stage , Use the brush tool to draw a square spiral .

Starting point X、y The coordinates are 0, The length of the first side is 5, The length of each side in the future increases in turn 5, Continuous painting 50 Such an edge .

1. Design ideas and implementation

(1) Role analysis

  • role : According to the title , Keep the kitten role unchanged .

(2) Background analysis

  • background : Default colorless background .

(3) Introduction to the building blocks used

a. Sports

  • The character moves the specified number of steps , A positive number is forward , Negative numbers are backward .

  • Rotate the character to the left by the specified angle

原网站

版权声明
本文为[Youth programming competition communication]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207072149233308.html