xxxxxxxxxx
26
let font, options, points, vehicles = [];
let txt = 'India';
function preload() {
font = loadFont('font.otf');
}
function setup() {
createCanvas(600, 400);
options = {
sampleFactor: 0.2
};
points = font.textToPoints(txt, 50, 300, 210, options);
for (let pt of points) {
vehicles.push(new Vehicle(pt.x, pt.y));
}
}
function draw() {
background(0);
for (let vehicle of vehicles) {
vehicle.behaviors();
vehicle.update();
vehicle.show();
}
}