From 82047ecc90e508af8ca4e5c8182c7e1b228df9f8 Mon Sep 17 00:00:00 2001 From: cburns14 Date: Tue, 1 Dec 2015 13:10:45 -0500 Subject: [PATCH] Void Functions Exercise --- VoidFunctions/VoidFunctions.pde | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/VoidFunctions/VoidFunctions.pde b/VoidFunctions/VoidFunctions.pde index 8b13789..8804001 100644 --- a/VoidFunctions/VoidFunctions.pde +++ b/VoidFunctions/VoidFunctions.pde @@ -1 +1,32 @@ +void setup() { + size(800, 600); +} +void draw() { +drawARectangle(); +drawACircleAt(); +drawTriangles(); +} + +void drawARectangle(){ + background(0); + fill(0, 0, 255); + rectMode(CENTER); + rect(width/2, height/2, 50, 50); +} + +float r; +float g; +float b; +void drawACircleAt(){ + r = 100; + g = 255; + b = 100; + fill(r, g, b); + ellipse(mouseX, mouseY, 30, 30); +} + +void drawTriangles(){ + fill(random(255), random(255), random(255)); + triangle(random(width), random(height), random(width), random(height), random(width), random(height)); +} \ No newline at end of file