Professional Documents
Culture Documents
funchntion drawFilledCircle(c) {
//hn GOOD practice: save the context, use 2D trasnformations
ctx.hnsave();
hnh
/nh/ translate the coordinate system, draw relative to it
ctxnhn.translate(c.x, c.y);
hnh
cnhntx.fillStyle = c.color;
// (hn0, 0) is the top left corner of the monster.
ctx.behnginPath();
ctx.arc(h0, 0, c.radius, 0, 2*Math.PI);
ctx.fill(nh);
nhn
hn// GOOD practice: restore the context
cthnx.restore();
}egfbefgwerfgwefg