mirror of
https://github.com/Cametendo/EMVs-Creative-coding.git
synced 2026-06-20 17:45:02 +02:00
Added file structure
This commit is contained in:
@@ -14,5 +14,7 @@
|
||||
|
||||
<body>
|
||||
<script src="sketch.js"></script>
|
||||
<a href="script_rectangles.html">Rectangles Script</a>
|
||||
<a href="script_labyrinth.html">Labyrinth Script</a>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
8
labyrinth.js
Normal file
8
labyrinth.js
Normal file
@@ -0,0 +1,8 @@
|
||||
function setup() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function draw() {
|
||||
|
||||
}
|
||||
25
rectangles.js
Normal file
25
rectangles.js
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
20
script_labyrinth.html
Normal file
20
script_labyrinth.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Sketch</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
|
||||
<script src="libraries/p5.min.js"></script>
|
||||
<script src="libraries/p5.sound.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="labyrinth.js"></script>
|
||||
<a href="script_rectangles.html">Rectangles Script</a>
|
||||
<a href="script_labyrinth.html">Labyrinth Script</a>
|
||||
</body>
|
||||
</html>
|
||||
20
script_rectangles.html
Normal file
20
script_rectangles.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Sketch</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
|
||||
<script src="libraries/p5.min.js"></script>
|
||||
<script src="libraries/p5.sound.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="rectangles.js"></script>
|
||||
<a href="script_rectangles.html">Rectangles Script</a>
|
||||
<a href="script_labyrinth.html">Labyrinth Script</a>
|
||||
</body>
|
||||
</html>
|
||||
25
sketch.js
25
sketch.js
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user