Skip to content

About

An object-oriented 2D solar system simulation built in Processing for a school project. Models gravitational interactions, orbital motion, and collisions between celestial bodies. Designed to demonstrate OOP principles, physics simulations, and flexible scenario setups for educational purposes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🌌 OOP Solar System Simulation

An object-oriented 2D solar system simulation built in Processing for a school project. This simulation models gravitational interactions, orbital motion, and collisions between celestial bodies — demonstrating key OOP principles, physics logic, and scalable simulation design.


🚀 Features

  • 🌍 Realistic orbital motion and gravitational pull
  • ☄️ Collision detection and fusion logic for asteroids and planets
  • 🔭 Auto-scaling camera that keeps all objects in frame
  • 🪐 Customizable scenarios (e.g., solar system, binary stars, supernova events)
  • 🧩 Fully object-oriented structure for modular and extensible code

🧠 Project Structure

/CelestialBodies
│
├── CelestialBodies.pde     # Main Processing sketch (entry point)
├── Camera.pde              # Handles camera scaling and center-of-mass tracking
├── CelestialDynamics.pde   # Core physics logic and gravity calculations
├── HelperFunctions.pde     # Utility functions (collision effects, drawing helpers)
└── Scenerios.pde           # Manages scenario data and celestial configurations

---

## 🛠️ How to Run

1. Install **[Processing](https://processing.org/download/)**.
2. Clone this repository:

   ```bash
   git clone https://github.com/deepakawicked/OOP-Solar-System.git
  1. Open Simulation.pde in Processing.
  2. Click Run ▶️ to start the simulation.

⚙️ Customization

  • Add new bodies by creating subclasses of Celestial.
  • Modify parameters like mass, velocity, or position.
  • Adjust camera padding and time steps in autoScaleCamera() for smoother zooming.
  • Experiment with Scenario.java to create unique systems.

📘 Notes

  • Created for a school project to demonstrate object-oriented programming and basic physics simulation.
  • Physics are simplified for visualization and learning purposes.
  • Free to modify, fork, and expand upon.

📄 License

This project is released under the MIT License. Feel free to use, modify, or learn from it.


About

An object-oriented 2D solar system simulation built in Processing for a school project. Models gravitational interactions, orbital motion, and collisions between celestial bodies. Designed to demonstrate OOP principles, physics simulations, and flexible scenario setups for educational purposes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages