allcoma, элементарно
CelestialBody.prototype.render = function(context) {
// ...
this.path = this.path || [];
this.path.push({ x: this.position.x, y: this.position.y });
context.beginPath();
context.moveTo(this.path[0].x, this.path[0].y);
for (var i = 1; i < this.path.length; i++) {
context.lineTo(this.path[i].x, this.path[i].y);
}
context.strokeStyle = this.fillStyle;
context.stroke();
};