No description, website, or topics provided.
JavaScript Other
Latest commit 76b2570 Oct 27, 2016 @simart simart committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.gitignore Create .gitignore Sep 20, 2015
README.md Update README.md Oct 27, 2016
Starfield.pde Update Starfield.pde Sep 30, 2015
index.html initial commit Oct 1, 2014
processing.js initial commit Oct 1, 2014
styles.css initial commit Oct 1, 2014

README.md

Starfield (with an Oddball and Jumbo)

For this assignment you will make a animation of fireworks. This common animation is called a "starfield" since it can also be used to simulate movement through a field of stars. You may find slides 1 - 131 on OOP.pptx helpful.

Program requirements:

Your program must use three classes to model the particles. A "Normal" particle class, an "Oddball" particle class and a "Jumbo" particle class. All the particles must be stored in a single array using an interface. The Jumbo particle class must use inheritance.

Suggested steps to completing this assignment

  1. Fork this repository
  2. First, finish the NormalParticle class. It will need the following members:
    • 5 member variables: X and Y positions, Color, Angle and Speed. (Hint: use doubles for X, Y, Speed and Angle)
    • NormalParticle(), the class constructor
    • void move(), Takes the cos of the angle times the speed and adds it to the X coordinate. Does the same to Y with the sin of the angle.
    • void show(), draws the particle in the correct color
  3. Now finish the program's setup() and draw()
  4. Add one NormalParticle variable, and make sure you can see it move
  5. Now modify the program so you have an array of NormalParticles.
  6. Run your program and make sure you can see all the particles move.
  7. Finish the Particle interface. It will list two methods:
    • public void show();
    • public void move();
  8. Have your NormalParticle implement the Particle interface.
  9. Add public in front of the move() & show() methods in your NormalParticle class.
  10. Create an OddballParticle class that implements the Particle interface.
  11. Finish the OddballParticle class. It will be similiar to the NormalParticle, but OddballParticles should have different move() and show() methods.
  12. Change your array of NormalParticles to an array of type Particle.
  13. Change the first element in the array to a OddballParticle instead of a NormalParticle
  14. Run your program. Make sure you can see the Oddball.
  15. Now, write a new Jumbo class that extends NormalParticle (or extends OddballParticle). In this class you will only need to override the one method public void show() to draw a larger ellipse.
  16. Change the second element in the array to a Jumbo instead of a normal Particle. Run your program and make sure you can see the Jumbo.
  17. Submit the url of your GitHub webpage via the school loop drop box for the assignment

Extensions: Have a fun and be creative. If you have extra time you may want to modify your program and add extra features. Experiment with different arrangements of particles. Look at student work from the links below for other variations.

Samples of Student Work

Vivian
Yolanda
Andy
Katie
Otto
Nghi
Darren
Gina
Maxwell
Adolfo
Erika
Silas
Andrea
Andrew
Michelle
Bryan
Wilson
Zhenwen
Jenna
Kenneth
Michelle
Kenny
Jun
Kelly
Nicholas
Darya
Brandon
Samantha
Thanawat
Andrew
Elton
Joanna
Nathan
Kirby
Sam
Wilson
Benjamin
Robert
Hannah
Joshua
Eric
Sharon
Bryce
Derek
Brandon
Lydia
Jayden
Aaron
Michael
Heath
Makayla
Victor
Janet
Felix
Schuyler
Preston
Ryan
Juan
Tatiana
Karen
Jonathan
Mike
Jessica
Raymond
Mikaela
Emma
Steven
Conna
Erica
Sophie
Graham
Colin