xxxxxxxxxx
28
class Friend {
constructor(stream, id){
this.id = id;
this.x = 0;
this.y = 0;
this.z = 0;
this.stream = stream;
this.rotationX = 0;
}
update(x,y,z){
this.x = x;
this.y = y;
this.z = z;
}
show(){
// run every frame
this.rotationX += 0.01;
push();
translate(this.x, this.y, this.z);
texture(this.stream);
rotateY(this.rotationX)
box(100, 100);
pop();
}
}