Discuss Scratch

HeroBrineNZK
Scratcher
82 posts

How do I draw a circle using scripts?


Hi everyone, can you please tell me how to draw a circle using blocks?
Thnx
drmcw
Scratcher
1000+ posts

How do I draw a circle using scripts?

Easiest way is
when flag clicked
go to x: (0) y: (100)
point in direction [90 v]
clear
pen down
repeat (360)
move (1) steps
turn cw (1) degrees
end
pen up
HeroBrineNZK
Scratcher
82 posts

How do I draw a circle using scripts?

Ok, thanks
Colorful!

when flag clicked
go to x: (0) y: (0)
point in direction [90 v]
clear
repeat (360)
move (1) steps
turn cw (1) degrees
change pen color by (1)
pen down
end
pen up

Last edited by HeroBrineNZK (Sept. 20, 2013 06:31:17)

-appletree-
Scratcher
43 posts

How do I draw a circle using scripts?

when green flag clicked
forever

turn ccw (15) degrees
move (10) steps
end
-appletree-
Scratcher
43 posts

How do I draw a circle using scripts?

-appletree- wrote:

when green flag clicked
forever

turn ccw (15) degrees
move (10) steps
end
pen down

oh do pen down!
Cyoce
Scratcher
500+ posts

How do I draw a circle using scripts?

define draw circle with radius (r) at x: (x) y: (y)
set [i v] to [0]
pen up
go to x: (x) y: ((y)+(r))
pen down
repeat (360)
go to x: ((x)+((r)*([sin v] of (i)))) y: ((y)+((r)*([cos v] of (i))))
change [i v] by (1)

Last edited by Cyoce (Jan. 3, 2015 21:49:46)

hppavilion
Scratcher
100+ posts

How do I draw a circle using scripts?

Cyoce wrote:

define draw circle with radius (r) at x: (x) y: (y)
set [i v] to [0]
pen up
go to x: (x) y: ((y)+(r))
pen down
repeat (360)
go to x: ((x)+((r)*([sin v] of (i)))) y: ((y)+((r)*([cos v] of (i))))
change [i v] by (1)
And if he wants an ellipse he should use:

define draw ellipse with radii (r1),(r2) at x: (x) y: (y)
set [i v] to [0]
pen up
go to x: (x) y: ((y)+(r))
pen down
repeat (360)
go to x: ((x)+((r1)*([sin v] of (i)))) y: ((y)+((r2)*([cos v] of (i))))
change [i v] by (1)

Last edited by hppavilion (Jan. 4, 2015 01:47:30)

Harakou
Scratcher
1000+ posts

How do I draw a circle using scripts?

-appletree- wrote:

when green flag clicked
forever

turn ccw (15) degrees
move (10) steps
end
This thread is over a year old and it looks like the question has already been answered. Please don't bump up old threads.

Powered by DjangoBB