Boids the Game is a simulation-based game that is inspired by Craig Reynolds' Boids algorithm, which models the flocking behavior of birds or fish. In this game, players can choose to control a boid known as a Hoid (herd-like boid) and survive as long as possible, or a Poid (predator-like boid) and hunt down as many Hoids as possible. The game is built using Java, JavaFX, and Maven, with a total of four screens: Main Menu, Settings, Scoreboard, and Game Screen.
Boids the Game is based on the Boids algorithm, which was developed by Craig Reynolds in 1986 as a model for simulating flocking behavior of birds or fish. The algorithm is simple, yet effective in creating realistic swarm-like movement patterns.
The Boids algorithm uses three basic rules to govern the behavior of each individual boid:
- Separation: Boids try to maintain a certain distance from other nearby boids to avoid collisions.
- Alignment: Boids attempt to align their direction and speed with the average direction and speed of nearby boids.
- Cohesion: Boids move towards the average position of nearby boids, effectively staying together as a group.
To get started with Boids the Game, follow these steps:
- Ensure you have Java and JavaFX installed on your system. If not, download and install them from the official websites.
- Clone or download the repository to your local machine.
git clone https://github.com/SverreNystad/boids-the-game.git cd boids-the-game
- Navigate to the project's root folder and run
mvn clean javafx:run
In Boids the Game, you can play as a Hoid or a Poid (predator boid).
The Boids algorithm simulates flocking behavior by trying to achieve local flock center, aligning velocity with neighboring boids, and maintaining a minimum distance from other boids. Hoids follow the Boids algorithm, while Poids target the nearest Hoid or PlayerBoid when in Hoid game mode. The PlayerBoid is the character that the player controls, and it follows the cursor in the game.
As a Poid, your goal is to hunt down and capture as many Boids as possible. The player-controlled Poid will also follow the cursor's last known position.
You can customize your gameplay experience through the settings screen. Here, you can adjust the number of Boids, the ratio of Hoids vs Poids, and enable or disable the map's wraparound feature.
The game features four main screens:
To run the test suite for Boids the Game, follow these steps:
- Navigate to the project's root folder.
- Run
mvn test
to execute the test suite.
We would like to thank Craig Reynolds for creating the Boids algorithm, which inspired the development of this game. Additionally, we appreciate the support of the Java, JavaFX, and Maven communities for their respective technologies.
Boids the Game is released under the MIT License. Please refer to the LICENSE
file in the project's root folder for the full text.