diff --git a/ReturningValues/ReturningValues.pde b/ReturningValues/ReturningValues.pde index 8b13789..13a8249 100644 --- a/ReturningValues/ReturningValues.pde +++ b/ReturningValues/ReturningValues.pde @@ -1 +1,23 @@ +float theta = 0; +float thetaStart = 0; +float circleSize = 100; +void setup() { + colorMode(HSB, 360, 100, 100, 100); + size(2800, 1200); +} + +void draw() { + theta = thetaStart; + background(0, 0, 100); + stroke(3); + println(sin(theta)); + for (int x = 0; x < width; x += circleSize - 20) { + noStroke(); + fill(map(x, 0, width, 0, 360), 100, 100, 50); + float y = map(sin(theta), -1, 1, height*.25, height*.75); + ellipse(x, y, circleSize, circleSize); + theta += .3; + } + thetaStart += .005; +} \ No newline at end of file diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..0a7e697 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,30 @@ +void setup() { + size(800, 600); +} +void draw() { + DrawABlueSquare(); + DrawACircle(100,0,200); + DrawATriangle(150); +} + +void DrawABlueSquare() { + fill(#082EFF); + rect(375, 275, 50, 50); +} + +void DrawACircle(float red, float green, float blue){ + fill(red,green,blue); + ellipse(mouseX,mouseY,30,30); +} + +void DrawATriangle(float d){ + fill(#0DA026); + triangle(40,75,60,20,d,d); +} + +/********************************* + how to define function: dataType name (parameters- that are not included in code){ + block of code + } +/**********************************/ \ No newline at end of file