xxxxxxxxxx
42
class Steer{
constructor(ctr,X=windowWidth/2,Y=windowHeight/2){
this.angle=0;
this.X=X;
this.Y=Y;
this.ctr=ctr;
}
show(ctr){
this.ctr=ctr;
push();
translate(this.X,this.Y);
rotate(this.angle);
fill(0);
noStroke();
rectMode(CENTER);
circle(0,0,300);
fill(255);
circle(0,0,230);
fill(0);
stroke(0);
strokeWeight(12);
beginShape();
curveVertex(-115,-40);
curveVertex(-115,-40);
curveVertex(0,-60);
curveVertex(115,-40);
curveVertex(115,0);
curveVertex(40,35);
curveVertex(20,115);
curveVertex(-20,115);
curveVertex(-40,35);
curveVertex(-115,0);
curveVertex(-115,-40);
curveVertex(-115,-40);
endShape();
stroke(0,0,255);
strokeWeight(5);
point(0,-150)
pop();
this.angle=map(min(this.ctr,windowWidth),0,windowWidth,-PI/2,PI/2);
}
}