public class Snow { public Point pos; public int size; public int speed; public bool IsActive; public int height; public int width; Color backColor; Graphics draw; public Snow() { this.draw = null; this.size = 0; this.pos = new Point(0, 0); this.speed = 0; this.IsActive = false; } public Snow(Graphics draw, Color backcolor, int height, int width, int xValue, int size, int speed) { this.draw = draw; this.backColor = backcolor; this.height = height; this.width = width; this.pos = new Point(xValue, 0); this.size = size; this.speed = speed; this.IsActive = true; } public void Fall(int windSpeed) { draw.DrawEllipse(new Pen(backColor), new Rectangle(pos, new Size(size, size))); if (pos.X + windSpeed > 0 && pos.X + windSpeed < width) { pos = new Point(pos.X + windSpeed, pos.Y + speed); draw.DrawEllipse(new Pen(Color.Blue), new Rectangle(pos, new Size(size, size))); if (pos.Y > height) { draw.DrawEllipse(new Pen(backColor), new Rectangle(pos, new Size(size, size))); this.IsActive = false; } } else { draw.DrawEllipse(new Pen(backColor), new Rectangle(pos, new Size(size, size))); this.IsActive = false; } } }