CS 140 - Homework 6 - Due Thursday April 9

In this homework you are going to modify our particle simulator so that it shoots a ray at random intervals at the particles.

Requirements

  1. You should simulate four particles
  2. A particle should bounce off another particle if they collide.
  3. Shoot your ray with a 2% probability.
  4. If the ray hits a particle the particle should turn red.
  5. The particles should be different colors but not initially red.
  6. Make the particles a random diameter between 20 and 30 pixels.
  7. Make sure this is turned in a folder named HW6 in your student folder.
  8. Hint: Write a method called shootParticles() that does the work of firing the ray and detecting whether a particle has been hit or not.

You can run my version of the program by double clicking on run.bat in the folder

T:/Harcourt/Fall2008/CS140/HW6/

Extra Credit

Add a short internal wall that the particles bounce off of. Shoot the ray in between the internal wall and the right wall. See the example in

T:/Harcourt/Fall2008/CS140/HW6Extra/