Skip to content

Instantly share code, notes, and snippets.

@AlphaGit
Created April 2, 2013 01:02
Show Gist options
  • Save AlphaGit/5289147 to your computer and use it in GitHub Desktop.
Save AlphaGit/5289147 to your computer and use it in GitHub Desktop.
//DrawableCircle: DrawableEntityBase
DrawableCircle.prototype = Object.create(DrawableEntityBase.prototype);
DrawableCircle.prototype.constructor = DrawableEntityBase;
function DrawableCircle(drawingContext, color, radius, centerX, centerY) {
DrawableEntityBase.call(this, drawingContext, color);
var self = this;
self.radius = radius;
self.centerX = centerX;
self.centerY = centerY;
self.draw = function() {
self.ctx.fillStyle = color;
self.ctx.ellipse(self.centerX, self.centerY, self.radius, self.radius, 0, 0, 0, false);
};
return {
draw: self.draw
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment