xxxxxxxxxx
32
var font;
var vehicles = [];
var points;
function preload() {
font = loadFont("AvenirNextLTPro-Demi.otf")
}
function setup() {
createCanvas(800, 500);
points = font.textToPoints("p5js", 100, 300, 300);
for (var i = 0; i < points.length; i++) {
pt = points[i]
var vehicle = new Vehicle(pt.x, pt.y, i)
vehicles.push(vehicle)
}
}
function draw() {
background(22, 23, 26);
for (var i = 0; i < points.length; i++) {
vehicle = vehicles[i]
vehicle.update();
vehicle.show();
}
}