Gravity Hearts (Flash Experiment)

In 2006, I wanted to build a gravity simulator in Flash.

It worked fairly well - what started as Planets eventually became Hearts when I entered a Valentines Day themed coding contest in 2007.

I didn't win the contest, but it was fun pulling it together - but also a learning experience: One thing I hadn't accounted for was how every object calculated the gravitational pull independently. This seemed like the right choice - it's how nature works, after all.

Then I realized that, with my application being single threaded, by the time the last object in the collection would calculate the force felt from an earlier object, the earlier object was not in the spot from where the force was being exerted.

Without getting into Einstein's theories on relativity, the resulting effect didn't look quite right.

While I eventually solved for it, I'll intentionally leave the solution as an exercise for the reader. The exercise made me a better coder - not because of the code itself, but because it refined the way I looked at problems.

Popular

Let's Clear Up The Ambiguity!

FAQs for a Software Engineering Hiring Manager

7 Steps to Writing an Amazing Resume

7 Steps to Building your Portfolio MVP

Work Experience vs Professional Experience