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