For one of my projects I was required to draw a circle using the pen(beginner stuff). I wanted to draw a simple circular spiral that stopped when the sprite hit the edge but was not sure how I should go about it.
This what I have so far
[scratchblocks]
when I receive Circle
pen down
repeat until touching side
repeat 360
move 1 step
turn 1 degree
end
end
Here it just draws one circle
Offline
souldude600 wrote:
For one of my projects I was required to draw a circle using the pen(beginner stuff). I wanted to draw a simple circular spiral that stopped when the sprite hit the edge but was not sure how I should go about it.
If you want a spiral, you'll need a variable. Try this:
when I receive [Circle v] set [variable v] to (1) pen down repeat until <touching [side v]?> move (variable) steps turn cw (1) degrees change [variable v] by (1) end
Last edited by Greenatic (2012-03-01 17:30:02)
Offline
Thanks, I'll see how this one goes.
Offline
souldude600 wrote:
Thanks, I'll see how this one goes.
I hope it works! You'll probably need a number higher than 1 for the rotate block, though...
Offline
That script you gave me causes the sprite just to pretty much go straight, it does not even create one circle. Is changing the move step by 1 correct?
Offline
Its not as circular as I was hoping for but thanks guys.
Offline
spirals are easier if you use polar co-ordinates (radius,angle) this demo will draw you an archimedean spiral
http://scratch.mit.edu/projects/Ratty1967UK/2366890
enjoy!
Offline