{
let canvas, ctx;
if (this) {
canvas = this, ctx = this.getContext("2d");
ctx.clearRect(0, 0, width, height);
} else {
ctx = DOM.context2d(width, height), canvas = ctx.canvas;
canvas.style.width = "100%";
canvas.style.height = "auto";
}
let {left: cx, top: cy} = canvas.getBoundingClientRect();
let {x: mx, y: my} = mouse;
let target = {x: mouse.x - cx, y: mouse.y - cy};
let vehicle1 = new Vehicle(50, 50);
while (playing) {
ctx.clearRect(0, 0, width, height);
ctx.beginPath();
ctx.arc(target.x, target.y, 10, 0, 2 * Math.PI);
ctx.fillStyle = "red";
ctx.fill();
vehicle1.seek(Victor.fromObject(target));
vehicle1.update();
ctx.fillStyle = "black";
vehicle1.display(ctx);
yield canvas;
}
}