xxxxxxxxxx
26
function Vehicle(x, y, id, dis) {
this.id = id
this.pos = createVector(x, y)
}
Vehicle.prototype.update = function(dis) {
this.r = this.dis2r(dis)
if (this.r >= 13) {
this.r = 12
}
}
Vehicle.prototype.show = function() {
var b = map(mouseX, 0, 800, 117, 116)
stroke(mouseX, mouseY, 117, 200);
strokeWeight(this.r)
point(this.pos.x, this.pos.y)
}
Vehicle.prototype.dis2r = function( dis ){
return dis / 12
}