class Ball extends Decoration{ graphics: p5.Graphics constructor(properties: object){ super(properties); this.createGraphics(); } createGraphics(){ let img = images['ball']; this.graphics = p.createGraphics(img.width, img.height); this.updateColor(); } updateColor(){ let img = images['ball']; this.graphics.clear(); this.graphics.tint(this.colors[0]); this.graphics.image(img, 0, 0); } display(pos?: p5.Vector, dim?: p5.Vector){ super.display(pos, dim); p.image(this.graphics, 0, 0, this.radius * 2, this.radius * 2); if (this.mouseIsOver){ this.brightness(70); } p.pop(); } update(){ super.update(); } }