canvas = {
var ctx;
if (this) {
ctx = this.getContext('2d');
} else {
ctx = DOM.context2d(width, height);
ctx.fillStyle = "black";
ctx.canvas.onmousemove = (e) => {
mutable mousePos = {x: e.offsetX, y: e.offsetY};
}
}
while (true) {
const x = Math.sin(Date.now() / 400) * (width/4.0 - 2 * radius) + radius;
ctx.clearRect(0, 0, width, height);
ctx.beginPath();
ctx.arc(mousePos.x + x, mousePos.y, 20, 0, 2 * Math.PI);
ctx.fill();
yield ctx.canvas;
}
}