Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sprite must draw circle
- Dmith
- Scratcher
1000+ posts
Sprite must draw circle
Help me, please. My sprite must make circle. Please, write down script or link to project.
Sprite1 (Main)when green flag clickedSprite2:
wait until <mouse down?>
broadcast [move center v]
wait until <not <mouse down?>>
wait until <mouse down?>
go to x: (mouse x) y: (mouse y)
set [radius v] to [distance to Sprite2 v]
set [step v] to (((radius) * (3.141592)) / 360)
go to x: ([x position v] of [Sprite2 v]) y: (([y position v] of [Sprite2 v]) + (radius)
point in direction (90 v)
pen down
repeat (360)
move (step) steps
turn right (1) degrees
end
pen upwhen I receive [move center v]
go to [mouse-pointer v]
Last edited by Dmith (Jan. 19, 2014 14:48:17)
- scubajerry
- Scratcher
1000+ posts
Sprite must draw circle
Looks close -
circumference is 2*pi*radius. It appears you have 1*pi*radius
Can you share your project?
circumference is 2*pi*radius. It appears you have 1*pi*radius
set [step v] to < (([2]*(distanc)) * [3.141592]) / [360]>//distanc = radius
Can you share your project?
Last edited by scubajerry (Jan. 19, 2014 12:25:37)
- Dmith
- Scratcher
1000+ posts
Sprite must draw circle
Thank you!!! You resolve all my problems!!! Looks close -
circumference is 2*pi*radius. It appears you have 1*pi*radiusset [step v] to < (([2]*(distanc)) * [3.141592]) / [360]>//distanc = radius
Can you share your project?
http://scratch.mit.edu/projects/16801956
Last edited by Dmith (Jan. 19, 2014 15:02:09)
- Discussion Forums
- » Help with Scripts
- » Sprite must draw circle