How to work with classes in Processing

I see.

A class is a special code section to join properties and methods of an object like a ball. The ball has size, color, position and values you add to the position to let it fly. All those are capsuled in a class so the code is better readable.

Additionally you add the functions of the ball to the class, such as fly(), show(), collide().

You can also make an array or ArrayList of the class of multiple objects which is more convenient than doing it with variables alone.

1 Like