diff --git a/index.html b/index.html index d8b43d3..acd1738 100644 --- a/index.html +++ b/index.html @@ -14,5 +14,7 @@ + Rectangles Script + Labyrinth Script diff --git a/labyrinth.js b/labyrinth.js new file mode 100644 index 0000000..0c65eb1 --- /dev/null +++ b/labyrinth.js @@ -0,0 +1,8 @@ +function setup() { + +} + + +function draw() { + +} \ No newline at end of file diff --git a/rectangles.js b/rectangles.js new file mode 100644 index 0000000..81505b6 --- /dev/null +++ b/rectangles.js @@ -0,0 +1,25 @@ +let r, g, b = 0; + +function setup() { + createCanvas(800, 800); + strokeWeight(5); +} + +function draw() { + frameRate() + background(100, 100, 100, 100); + for(i = 0; i < 1; i++) { + stroke(random(255), random(255), random(255)) + noFill() + const rectWidthStatic = random(600); + const rectHeightStatic = random(600); + const rectWidthMouse = random(300); + const rectHeightMouse = random(300); + const rectMidX = (width/2) - (rectWidthStatic/2); + const rectMidY = (height/2) - (rectHeightStatic/2); + const offsetX = random(-40, 40); + const offsetY = random(-40, 40); + rect(rectMidX + offsetX, rectMidY + offsetY, rectWidthStatic, rectHeightStatic); + rect(mouseX + offsetX, mouseY + offsetY, rectWidthMouse, rectHeightMouse); + } +} \ No newline at end of file diff --git a/script_labyrinth.html b/script_labyrinth.html new file mode 100644 index 0000000..2620549 --- /dev/null +++ b/script_labyrinth.html @@ -0,0 +1,20 @@ + + + + + + + Sketch + + + + + + + + + + Rectangles Script + Labyrinth Script + + diff --git a/script_rectangles.html b/script_rectangles.html new file mode 100644 index 0000000..7cd8deb --- /dev/null +++ b/script_rectangles.html @@ -0,0 +1,20 @@ + + + + + + + Sketch + + + + + + + + + + Rectangles Script + Labyrinth Script + + diff --git a/sketch.js b/sketch.js deleted file mode 100644 index 0828b9f..0000000 --- a/sketch.js +++ /dev/null @@ -1,25 +0,0 @@ -let r, g, b = 0; - -function setup() { - createCanvas(800, 800); - strokeWeight(5); - - -} - -function draw() { - frameRate() - background(100, 100, 100, 100); - for(i = 0; i < 1; i++) { - stroke(random(255), random(255), random(255)) - noFill() - const rectWidth = random(300); - const rectHeight = random(300); - const rectMidX = (width/2) - (rectWidth/2); - const rectMidY = (height/2) - (rectHeight/2); - const offsetX = random(-40, 40); - const offsetY = random(-40, 40); - rect(rectMidX + offsetX, rectMidY + offsetY, rectWidth, rectHeight); - rect(mouseX + offsetX, mouseY + offsetY, rectWidth, rectHeight); - } -} \ No newline at end of file