Skip to content

Latest commit

 

History

History
161 lines (115 loc) · 7.94 KB

week4.asciidoc

File metadata and controls

161 lines (115 loc) · 7.94 KB

Nature of Code: Week 4

Introduction to Particle Systems

Confused by this video?

Post any questions or comments here.

What is an ArrayList?

Confused by this video?

Post any questions or comments here.

Removing Elements from an ArrayList

Confused by this video?

Post any questions or comments here.

A Particle System class

Confused by this video?

Post any questions or comments here.

Inheritance and Polymorphism

Confused by this video?

Post any questions or comments here.

Homework Week 4

At this point we’re a bit deeper in the semester and approaching the midterm project. Feel free to simply start on a midterm idea or continue something you’ve been working on previously. If you would like to try an exercise related to particle systems, here are some suggestions:

  • Use a particle system in the design of a "Mover" object. In other words take, say, one of our earlier examples and instead of rendering a Mover object as a simple circle, emit particles from the mover’s location. For example, building off Chapter 3’s "Asteroids" example, use a particle system to emit particles from the ship’s “thrusters” whenever a thrust force is applied. The particles’ initial velocity should be related to the ship’s current direction.

  • Create a particle system where the particles respond to each other via forces. For example, what if you connect the particles with spring forces? Or an attraction / repulsion force?

  • Model a specific visual effect using a particle system — fire, smoke, explosion, waterfall, etc.

  • Create a simulation of an object shattering into many pieces. How can you turn one large shape into many small particles? What if there are several large shapes on the screen and they shatter when you click on them?

  • Create a particle system in which each particle responds to every other particle. (Note we’ll be doing this in detail in Week 6.

  • Create a particle system with different “kinds” of particles in the same system. Try varying more than just the look of the particles. How do you deal with different behaviors using inheritance?

  • Use an array of images and assign each Particle object a different image. Even though single images are drawn by multiple particles, make sure you don’t call loadImage() any more than you need to, i.e. once for each image file.

As always, please create a web page to document your homework. Make sure it include some visual documentation of your work as well as the source code.