Monday, May 16, 2011

Examples of using classes

Straggle

This code uses several class functions to control different aspects of the lines.

Particle Class
This holds info and functions pertaining to each line's vectors

The Line Class
Line segment information is stored here. It keeps track of the line's hue

Canvas Class
Keeps track of the lines in here. The Canvas Class just holds all the coordinate data, and provides a function for drawing everything.

The classes provide the information need to to draw the lines just as blue prints provide the information to build an object or machine

Rotate


This example only has one class which is the particle class. Each particle is created and then controlled by information provided in the class.

9000 particles are created and then each one is controlled by the variables in the class

No comments:

Post a Comment