Skip to content

A biological world simulation of predators and preys built using Python and Pygame.

License

Notifications You must be signed in to change notification settings

aclfe/BioSimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 BioSimulator

BioSimulator is a biological world simulation built using Python and Pygame. In a dynamic environment, red blobs (predators) hunt green blobs (prey). Prey multiply over time, while predators rely on consuming them to survive β€” mimicking real-life ecological balance.

This simulation provides a visual and interactive way to understand basic population dynamics and predator-prey interactions.


Demo

Demo

🌱 Features

  • Predators (Red) actively chase prey blobs.
  • Prey (Green) multiply naturally over time.
  • Basic simulation of population balance and survival.
  • Graphs to visually show population
  • Visually dynamic environment using Pygame.
  • Realistic movement and interaction patterns.

πŸš€ Installation

  1. Clone the repository
    git clone https://github.com/yourusername/BioSimulator.git
    
    cd BioSimulator
  2. Install the requirements
    pip install -r requirements.txt
  3. Run the program
    python main.py

πŸ’» Tweaks

src -> entites. There will be a config.py

The file will look as such:

SCREEN_WIDTH = 900
SCREEN_HEIGHT = 600
FPS = 60 

...

Make changes as you feel free to test out the program in different parameters/conditions.

🀝 Contributing

We welcome contributions! Here’s how you can help:

Fork the project. Create your feature branch (git checkout -b feature/your-feature). Commit your changes (git commit -am 'Add new feature'). Push to the branch (git push origin feature/your-feature). Create a Pull Request.

Ideas for contributions:

  • Improving predator/prey logic
  • Adding GUI sliders for controls
  • Optimizing performance (Numba, JIT, etc.)
  • Enhancing visual aesthetics

πŸ€” FAQ

Q: How many agents can this handle? A: Around 300+ agents can be simulated before performance starts dropping. Code not fully optimized.

About

A biological world simulation of predators and preys built using Python and Pygame.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages