Now with kids mode
This commit is contained in:
7
pizza.js
7
pizza.js
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user