Now with kids mode

This commit is contained in:
Eric Ratliff
2025-06-25 23:28:10 -05:00
parent 681feab148
commit a569e6b7d2
5 changed files with 109 additions and 57 deletions

View File

@@ -10,8 +10,9 @@ class Pizza {
this.pos = createVector(random(width), random(height));
}
}
this.vel = p5.Vector.random2D();
this.vel.mult(random(1, 3));
this.baseVel = p5.Vector.random2D();
this.speed = window.kidMode ? random(0.5, 1.5) : random(1, 3);
this.vel = this.baseVel.copy().mult(this.speed);
this.total = floor(random(8, 12)); // For potential future use
this.offset = [];
for (let i = 0; i < this.total; i++) {
@@ -20,6 +21,8 @@ class Pizza {
}
update() {
this.speed = window.kidMode ? random(0.5, 1.5) : random(1, 3);
this.vel = this.baseVel.copy().mult(this.speed);
this.pos.add(this.vel);
}