Now with kids mode
This commit is contained in:
@@ -2,11 +2,14 @@ class Hamburger {
|
||||
constructor(pos, r) {
|
||||
this.pos = pos.copy();
|
||||
this.r = r ? r / 2 : random(20, 30);
|
||||
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);
|
||||
}
|
||||
|
||||
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