A simple 2D physics engine built in NetLogo. This project demonstrates how to simulate turtle-based agents with mass, velocity, and elastic collisions in a 2D environment. It also features gravity and boundary collisions (bouncing off walls).
This repository contains a NetLogo model that demonstrates basic 2D physics, focusing on:
- Movement under velocity and gravity,
- Collisions between turtles (elastic),
- Boundary collisions (bouncing off walls).
It is an educational example showing how to implement a rudimentary physics engine in the NetLogo environment.
- Gravity pulling turtles downward.
- Elastic collisions between circular turtles, with mass influencing collision outcomes.
- Bounce off world boundaries, reversing velocity when hitting walls.
- Configurable number of turtles, speeds, masses, etc.
- NetLogo (version 6.4.0 or later).
You can download NetLogo from the official website.
- Clone this repository or download it as a ZIP:
git clone https://github.com/your-username/your-repo-name.git
- Open NetLogo on your computer.
- Open the .nlogo file from within NetLogo (File → Open...).