CMSC 280 -- Lab 3

Lab 3

Getting Started

Make a copy of your lab2 directory and rename the directory lab3.

The Problem

In the last lab you built a system to simulate particles using the seek behavior. You will extend your previous lab in several ways.
  1. Allow multiple particles
  2. Build a GUI to control the simulation
    1. Change the number of particles
    2. Change parameters (maxForce, maxSpeed, steering)
  3. Save/Load your simulation from a file
  4. Add two steering behaviors
    1. wander -- to be added
    2. flee -- the opposite of steer
	public double heading(){
		return Math.atan2(x,y);
	}
    public void wander() {
        wanderTheta +=(Math.random()*0.2)-0.1;

        Coord circle = new Coord(vel.x,vel.y);
        circle.normalize();
        circle.multiply(200);
        circle.add(pos);

        double heading = vel.heading();
        Coord pointOnCircle = new Coord(100*Math.cos(wanderTheta+heading),100*Math.sin(wanderTheta+heading));

        pointOnCircle.add(circle);
        seek(pointOnCircle);
    }

You must use a Makefile. Please remember to submit a README.txt

This is not your friend’s work. This is not the internet’s work. This is your work...

Handin

When you are done you may hand in your lab by using make handin.

The lab is due at 11:59pm Oct. 31th 2018.