From 49b16884c57b91492427cfd5d6417ea8e5188e6f Mon Sep 17 00:00:00 2001 From: Boof <97455552+hexahigh@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:04:50 +0200 Subject: [PATCH] update --- Games/move-cube/js/draw.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Games/move-cube/js/draw.js b/Games/move-cube/js/draw.js index 90aef86..5e877c8 100644 --- a/Games/move-cube/js/draw.js +++ b/Games/move-cube/js/draw.js @@ -7,11 +7,12 @@ var rectY = 0; function draw() { background(220); + translate(windowWidth / 2, windowHeight / 2); rect(rectX, rectY, 40, 40); //For (var BEGIN; END; INTERVAL){ //DO SOMETHING } - for (var x = 0; x < width; x += width / windowWidth) { - for (var y = 0; y < height; y += height / windowHeight) { + 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); @@ -44,13 +45,5 @@ function keyReleased() { } function windowResized() { - for (var x = 0; x < width; x += width / windowWidth) { - for (var y = 0; y < height; y += height / windowHeight) { - stroke(0); - strokeWeight(1); - line(x, 0, x, height); - line(0, y, width, y); - } - } resizeCanvas(windowWidth, windowHeight); } \ No newline at end of file