var GreenParticle = function(position, mass) { AttractionParticle.call(this, position, mass) this.render = function() { push() translate(this.position.x, this.position.y); fill(0, 255, 0,80) ellipse(0, 0, this.mass, this.mass) pop() } } GreenParticle.prototype = Object.create(AttractionParticle.prototype); GreenParticle.constructor = GreenParticle;