// accepts a vector array
// vector is simpy typeof {x: number, y: number}
function drawPolygon(points: Vector[]) {
this.context.beginPath();
this.context.moveTo(points[0].x, points[0].y);
for (let i = 1; i < points.length; i++) {
this.context.lineTo(points[i].x, points[i].y);
}
this.context.closePath();
this.context.fill();
this.context.stroke();
}