{"id":18647713,"url":"https://github.com/nikorasu/pynboids","last_synced_at":"2025-04-11T13:30:49.876Z","repository":{"id":43167851,"uuid":"348083496","full_name":"Nikorasu/PyNBoids","owner":"Nikorasu","description":"This is a Boids Simulation, written in Python with Pygame.","archived":false,"fork":false,"pushed_at":"2022-11-21T21:35:53.000Z","size":2126,"stargazers_count":40,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-01-27T18:35:12.183Z","etag":null,"topics":["birds","boid","boids","boids-algorithm","boids-simulation","emergent-behavior","flocking","flocking-algorithm","flocking-simulation","murmuration","numpy","pygame","pygame2","python","python3","schooling","screensaver","simulation","spatial-partitioning","swarm-intelligence"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nikorasu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-15T18:37:28.000Z","updated_at":"2024-01-09T19:36:21.000Z","dependencies_parsed_at":"2023-01-21T12:33:30.242Z","dependency_job_id":null,"html_url":"https://github.com/Nikorasu/PyNBoids","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikorasu%2FPyNBoids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikorasu%2FPyNBoids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikorasu%2FPyNBoids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nikorasu%2FPyNBoids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nikorasu","download_url":"https://codeload.github.com/Nikorasu/PyNBoids/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223469341,"owners_count":17150329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["birds","boid","boids","boids-algorithm","boids-simulation","emergent-behavior","flocking","flocking-algorithm","flocking-simulation","murmuration","numpy","pygame","pygame2","python","python3","schooling","screensaver","simulation","spatial-partitioning","swarm-intelligence"],"created_at":"2024-11-07T06:27:37.505Z","updated_at":"2024-11-07T06:27:37.986Z","avatar_url":"https://github.com/Nikorasu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyNBoids\n![Preview](preview.gif \"Preview\")\n\n### A Python Boids Simulation\nThis is a [Boids simulation](https://en.wikipedia.org/wiki/Boids \"Wikipedia\"),\nwritten in Python3, with Pygame2 and NumPy.\n\n**To use:** Save the `pynboids_sp.py` file (and `nboids.png` if you want the\nicon, not required) and run via python. (Example: `python3 pynboids.py`)\n\n`Esc` key to quit.\n\nI've included several customizable settings near the top of the code.  \nYou can adjust window size, fullscreen, fps, and how many boids to spawn,\nas well as whether they avoid the screen edges or wrap to the other side,\nchange the background color, or turn the boids into fish! ;)\n\n##### Update (11/14/22):\nMinor updates to several files. New `nboids_ss.py` version is a linux-only\npseudo-screensaver that **_requires_** _xprintidle_ be installed. BUT, due\nto a possible memory leak, the screensaver must be started using `run_ss.py`.\n\n##### Update (5/20/21):\nNew `pynboids_sp.py` version, implements a spatial partitioning grid to\nimprove efficiency of detecting other boids. Most efficient version so far!\n\n##### Update (5/16/21):\nAdded `pynboids2.py` version, an update to the original pynboids, with numpy\narray methods from pixelboids.py to improve efficiency. 2x more boids then b4.\n\n##### Update (5/14/21):\nAdded `pixelboids.py` version, draws boids as pixels in surfarray that fades\nas they move. Distance sorting \u0026 for-loop math replaced with numpy array math.\nUses a fading surfArray to create tails, pixelation makes them look animated.\n\n#### Special Thanks:  (Let me know if I forgot anyone.)\nI couldn't have gotten this far without the Pygame Discord channel:  \nCozyFractal, for help with the spatial partition grid \u0026 improving efficiency.  \nMega_JC, Ghast, and bydariogamer, for answering various questions I had.\n\nFor more information, and future updates,\n[see github page](https://github.com/Nikorasu/PyNBoids \"PyNBoids\").\n\n---\n\n        This program is free software: you can redistribute it and/or modify\n        it under the terms of the GNU General Public License as published by\n        the Free Software Foundation.\n\n        This program is distributed in the hope that it will be useful,\n        but WITHOUT ANY WARRANTY; without even the implied warranty of\n        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n        GNU General Public License for more details.\n\n        You should have received a copy of the GNU General Public License\n        along with this program.\n        If not, see: https://www.gnu.org/licenses/gpl-3.0.html\n\n###### Copyright (c) 2021  Nikolaus Stromberg - nikorasu85@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikorasu%2Fpynboids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikorasu%2Fpynboids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikorasu%2Fpynboids/lists"}