class Coin extends Sprite {
    constructor(x, y, radius = 10) {
        super(x, y, radius * 2, radius * 2);
        this.radius = radius;
    }

    update(sprites, input, mouse) {
        for (let s of sprites) {
            if (s instanceof Player && CollisionManager.isColliding(this, s)) {
                return true; // remove coin
            }
        }
        return false;
    }

    draw(ctx) {
        ctx.fillStyle = 'gold';
        ctx.beginPath();
        ctx.arc(this.x + this.radius, this.y + this.radius, this.radius, 0, 2 * Math.PI);
        ctx.fill();
    }
}