Pulsing Circles

The goal of this week’s p5 sketch is to organize code in an object oriented way.

I decided to alter an old processing sketch of mine and create a canvas full of pulsing circles.

I created a “pulse.js” file separately to house the “Pulse class”, in which the variables (x position, y position, diameter and speed) are declared, and functions of the pulses (display, grow and shrink) are defined.

This made my setup and draw functions in the main sketch simple and clean.

 

No Comments

Post A Comment