Code Monkey home page Code Monkey logo

flappybirdai's Introduction

FlappyBird AI

This project is a simple implementation of the classic Flappy Bird game with an added twist โ€“ it incorporates an AI agent trained using the NEAT (NeuroEvolution of Augmenting Topologies) algorithm to play the game. The AI learns to navigate through pipes and accumulate a higher score over generations.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/flappybird-ai.git
    cd flappybird-ai
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Run the game:

    python flappybird_ai.py

Usage

The game can be played manually or left to run autonomously with the AI taking control. The AI is trained using the NEAT algorithm and evolves over multiple generations to improve its performance.

Game Controls

  • Space Bar: Jump (Manual mode)
  • Close Window Button: Quit the game

Training the AI

The AI is trained automatically during the execution of the game. It uses the NEAT algorithm to evolve neural networks for the bird entities. The training progress and generation statistics are displayed on the game window.

Configuration

The game's behavior and AI training parameters can be configured using the config-feedforward.txt file. Adjustments to parameters such as mutation rates, population size, and neural network architecture can be made to experiment with different training strategies.

Dependencies

  • Python 3.x
  • Pygame
  • NEAT-Python

Install the required dependencies using the provided requirements.txt file.

pip install -r requirements.txt

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code for your own purposes.

flappybirdai's People

Contributors

momo-senpai avatar

Stargazers

Rajat Joshi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.