Skip to content

Commit

Permalink
return switch on resize
Browse files Browse the repository at this point in the history
  • Loading branch information
MRo47 committed May 19, 2024
1 parent 21cc4e6 commit 951b8b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions flow-fields/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ function preload() {
sound = loadSound('assets/ambient-wave-48-tribute-17243-pixabay.mp3')
}

function drawSwitch() {
background(0);
fill(255);
circle(width / 2, height / 2, min(width, height) / 3);
}

function setup() {
frameRate(fps);
getAudioContext().suspend();
Expand All @@ -27,13 +33,12 @@ function setup() {
var dir = createVector(cos(angle), sin(angle));
particles[i] = new Particle(loc, dir, speed);
}
background(0);
fill(255);
circle(width / 2, height / 2, min(width, height) / 3);
drawSwitch();
}

function windowResized() {
resizeCanvas(windowWidth, windowHeight);
drawSwitch();
}


Expand Down

0 comments on commit 951b8b5

Please sign in to comment.