Skip to content

felipearosr/boids-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boids Python

This project is a pixel-based Boids simulation implemented in Python using the Pygame library. It demonstrates the principles of Boid behavior, such as alignment, cohesion, and separation, in a visually appealing pixel array format.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.x
  • Pygame
  • Numpy

You can install Pygame and Numpy using pip:

pip install pygame numpy

Installation

1.Clone the repository to your local machine:

git clone https://github.com/felipearosr/boids-python

2.Navigate into the project directory:

cd boids-python

3.Run the main file to start the simulation:

python main.py

Configuration

The simulation can be customized through the settings.py file where you can adjust parameters such as screen size, number of boids, speed, and more. Files

  • main.py: The entry point of the application. It sets up the Pygame window and contains the main game loop.
  • boid.py: Contains the BoidPix class which defines the behavior and properties of each boid.
  • surface.py: Contains the SurfaceArray class which manages the pixel surface where boids are drawn.
  • settings.py: Contains all configuration settings for the simulation.
  • vector.py: Provides vector utilities, notably for rotating vectors.

Acknowledgments

Nikolaus Stromberg for the original PixelBoids concept and code.

About

Boids problem simulation in python.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages