Skip to content

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.

License

Notifications You must be signed in to change notification settings

SverreNystad/boids-the-game

Repository files navigation

Boids the Game README

Boids title

GitHub top language GitHub language count License: MIT

Table of Contents

Description of Boids the Game

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.

Description of the Boids Algorithm

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:

  1. Separation: Boids try to maintain a certain distance from other nearby boids to avoid collisions.
  2. Alignment: Boids attempt to align their direction and speed with the average direction and speed of nearby boids.
  3. Cohesion: Boids move towards the average position of nearby boids, effectively staying together as a group.

Getting Started

To get started with Boids the Game, follow these steps:

  1. Ensure you have Java and JavaFX installed on your system. If not, download and install them from the official websites.
  2. Clone or download the repository to your local machine.
    git clone https://github.com/SverreNystad/boids-the-game.git
    cd boids-the-game
  3. Navigate to the project's root folder and run
    mvn clean javafx:run

Gameplay

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.

Poid:

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.

Game Settings:

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.

Game Screens:

The game features four main screens:

  1. Main Menu: Start a new game or access the settings and scoreboard. image

  2. Settings: Customize the gameplay experience. image

  3. Scoreboard: View the highest scores achieved. image

  4. Game Screen: Play the game. image Image from Gyazo Image from Gyazo

Testing

To run the test suite for Boids the Game, follow these steps:

  1. Navigate to the project's root folder.
  2. Run mvn test to execute the test suite.

Acknowledgements

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.

License

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages