class Snowflake { private float posX, posY, velocity, size; private boolean hasFallen = false; private color col; public Snowflake(float posX, float posY, float velocity, float size, color col) { this.posX = posX; this.posY = posY; this.velocity = velocity; this.size = size; this.col = col; } public void draw() { fill(col); noStroke(); drawStar(posX, posY, size, size * 0.5, 8); } public void setY(float posY) { this.posY = posY; } public void update() { if (canFallTo(int(this.posX), int(this.posY + velocity), this.size / 2.0)) { this.posY += velocity; } else { hasFallen = true; } } public boolean hasFallen() { return this.hasFallen; } }