Start Here
Start Here
1 of 10
|1| Let’s draw some shapes
background(100)
circle(300, 300, 50)
ellipse(350, 200, 150, 50)
square(100, 200, 100)
rect(50, 50, 500, 100)
triangle(500, 200, 350, 400, 500, 400)
line(200, 550, 600, 400)
2 of 10
|2| Let’s colour the background
background(255, 0, 0)
circle(300, 300, 100)
3 of 10
|3| Let’s color the circle
background(255, 0, 0)
fill(200, 200, 0)
circle(300, 300, 100)
You can now fill it with whatever color you want. This will
work for all the other shapes except for a line.
4 of 10
|4| Coloring the line
background(255, 0, 0)
stroke(0, 0, 255)
line(200, 550, 600, 400)
circle(300, 300, 100)
This color the lines in the same way. Here it will give
you a blue line and a blue edge to any shape.
5 of 10
|5| Making the lines thicker
background(255, 0, 0)
stroke(0, 0, 255)
strokeWeight(5)
line(200, 550, 600, 400)
circle(300, 300, 100)
6 of 10
|6| Getting rid of the lines
background(255, 0, 0)
noStroke()
circle(300, 300, 100)
Now you can get rid of the line round the shape by using
noStroke().
Draw two circles, have a red border round one of them and
no border round the other
7 of 10
|7| Creating a variable
var x = 100
var y = 300
background(200, 100, 0)
circle(x, y, 100)
Change the values from 100 and 300 to other values and
could you make the diameter a variable as well. You can
call it anything you like.
8 of 10
|8| Let’s make some random dots
var x = 0
var y = 0
var r = 20
background(200, 100, 0)
function loop()
{
x = random(800)
y = random(600)
circle(x, y, r)
}
9 of 10
|9| Let’s make the color random
var x = 0
var y = 0
background(200, 100, 0)
function loop()
{
x = random(800)
y = random(600)
fill(random(255), random(255), random(255))
circle(x, y, 20)
}
10 of 10