public class Line extends Particle { private float theta; private float rate; /** * Parameterized constructor expects values for position, velocity, acceleration, * and particle size (in that order). */ public Line (Vector2D position, Vector2D velocity, Vector2D acceleration, float pWidth, float pHeight) { super(position, velocity, acceleration, pWidth, pHeight); theta = 0; rate = random(-0.1, 0.1); } /** * Method for rendering the line: */ public void render () { smooth(); stroke(150, 180, 256, 200); pushMatrix(); translate(position.getX(), position.getY()); rotate(theta); line(-pWidth/2, 0, pWidth/2, 0); theta += rate; popMatrix(); noStroke(); } }