The ballroom party…

Sia Chang
2 min readSep 30, 2020
Here you have it — The Ballroom party (A room full of balls…)

When I first thought of a dance party, I thought of the lights, the music, the beats, and the people dance with the confidences coming from nowhere. So I want to create something that can reflect all these aspects.

I got the inspiration of using neatly arranged dots as the background form the picture below, in which circles in different shapes and colors are mixed together.

First, I created a black canvas and used a nested for loop to create the dots in the background. By setting the lengths and widths to random, the dots are able to pop and change shapes to represent the visual effect for the dance floor. I also picked a neon green for the color to create a futuristic feeling.

Next is to create the dancers, aka the moving balls. (It’s a BALLroom party.) I created a class Circle and with multiple functions inside to give the class objects different attributes, including sizes, positions, speeds, and colors.

For the color, I intended to use RGB color system to give each new object a random color but accidentally discovered how to create the flashing effect by assigning a random number in the fill() function.

And here is the final Ballroom party, enjoy!

https://editor.p5js.org/xc2028/present/Ab8cfpfEp

As for why I call it a ballroom party despite the fact it’s clearly not, it’s a room full of balls… duh.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet