This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-01 17:21:38

souldude600
New Scratcher
Registered: 2012-03-01
Posts: 4

Need help for making A spiral

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

 

#2 2012-03-01 17:27:59

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Need help for making A spiral

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

 

#3 2012-03-01 17:30:36

souldude600
New Scratcher
Registered: 2012-03-01
Posts: 4

Re: Need help for making A spiral

Thanks, I'll see how this one goes.

Offline

 

#4 2012-03-01 17:31:56

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Need help for making A spiral

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

 

#5 2012-03-01 17:41:02

souldude600
New Scratcher
Registered: 2012-03-01
Posts: 4

Re: Need help for making A spiral

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

 

#6 2012-03-01 17:42:32

schusteralex2
Scratcher
Registered: 2011-09-17
Posts: 1000+

Re: Need help for making A spiral

try making the rotate block 10  hmm


http://i44.tinypic.com/2uj37ds.gif

Offline

 

#7 2012-03-01 17:46:33

souldude600
New Scratcher
Registered: 2012-03-01
Posts: 4

Re: Need help for making A spiral

Its not as circular as I was hoping for but thanks guys.

Offline

 

#8 2012-03-01 18:55:02

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Need help for making A spiral

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

 

Board footer