This commit is contained in:
Boof 2023-03-27 11:55:53 +02:00 committed by GitHub
parent 40ba911587
commit 5c0dbdfbee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -5,7 +5,7 @@
<script src="https://cdn.jsdelivr.net/npm/p5@1.6.0/lib/p5.js"></script>
<script src="js/draw.js"></script>
</head>
<body>
<body style="margin: 0; overflow: hidden;">
<main></main>
</body>
</html>

View File

@ -1,5 +1,5 @@
function setup() {
createCanvas(400, 400);
createCanvas(windowWidth, windowHeight);
}
var rectX = 200;
@ -7,7 +7,7 @@ var rectY = 200;
function draw() {
background(220);
rect(rectX, rectY, 40, 40, 20);
rect(rectX, rectY, 40, 40);
//For (var BEGIN; END; INTERVAL){
//DO SOMETHING }
for (var x = 0; x < width; x += width / 40) {
@ -41,4 +41,8 @@ function keyReleased() {
} else if (keyCode == DOWN_ARROW) {
rectY += 40;
}
}
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}