Skip to content
Simple simulator that accounts for gravity and collisions. The location you click will be where a ball is spawned, the distance you drag it will determine the magnitude of its velocity, the direction you drag it will determine the direction, and finally the length of time you hold it will determine its size/mass.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes
.gitignore
Field.java
Main.java
README.md
Window.java

README.md

Gravity-Collision-Simulator

A simple implementation of a two dimensional collision simulator using javax.swing. The location you click will be where a ball is spawned, the distance you drag it will determine the magnitude of its velocity, the direction you drag it will determine the direction, and finally the length of time you hold it will determine its size/mass.

You can adjust the coefficient of resistitution, frames per second, the acceleration of gravity, and the path size.

The physics equations used afre those you would typically find in a twelfth grade physics class.

Finally, balls can be created within other balls and the program will adjust so that there is no overlap.

You can’t perform that action at this time.