test p5.js

This commit is contained in:
Boof 2023-03-27 11:31:15 +02:00 committed by GitHub
parent 9df1a63624
commit 0f6e6e79e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Cube mover</title>
<script src="https://cdn.jsdelivr.net/npm/p5@1.6.0/lib/p5.js"></script>
<script src="draw.js"></script>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,17 @@
function setup() {
createCanvas(40, 40);
}
function draw() {
background(220);
//For (var BEGIN; END; INTERVAL){
//DO SOMETHING }
for (var x = 0; x < width; x += width / 40) {
for (var y = 0; y < height; y += height / 40) {
stroke(0);
strokeWeight(1);
line(x, 0, x, height);
line(0, y, width, y);
}
}
}