borntofrappe / code

Explore software
0 stars 0 forks source link

Demo — attraction and repulsion #11

Closed borntofrappe closed 3 years ago

borntofrappe commented 3 years ago

Recreate this demo from the coding train website.

borntofrappe commented 3 years ago

The physics involved in the project provides a good foundation for other projects, like games for the borntofrappe/game-development repository.

borntofrappe commented 3 years ago

Reviewing the coding challenge after issue #12 it is important to note that the two share the same physics in terms of the movement of the particle.

To get started, I'd like to implement two demos:

borntofrappe commented 3 years ago

I grew rather dissatisfied with the first demo, especially due to the "magic numbers" involved in the different formulas. After reviewing vector math, however, I was able to understand the underlying concepts considerably more.

The second demo cemented this progress with a rather intriguing playground. Particles are attracted to an object, and it is furthermore possible to include additional attractors with mouse input. Just like in the video introducing the issue.