Welcome to the Flappy Bird AI Project! This project showcases a simple yet impressive implementation of the classic Flappy Bird game, integrated with computer vision techniques to allow AI to play the game autonomously. The goal of this project is to demonstrate the power of AI in real-time gameplay scenarios, providing a solid example for those interested in game development and artificial intelligence.
flappy-bird-ai/
│
├── ai/
│ ├── model.py # Defines the AI model
│ ├── play.py # Script to run the game with AI
│ └── train.py # Script to train the AI model
│
├── game/
│ ├── flappy_bird.py # Main game script
│ └── assets/ # Game assets (images, sounds, etc.)
│
├── data/
│ └── collected_data/ # Collected gameplay data for training
│
├── model/
│ └── pretrained_model.h5 # Pre-trained model file
│
├── requirements.txt # Project dependencies
└── README.md # Project documentation
- Introduction
- Features
- Installation
- Usage
- Project Structure
- Technologies Used
- Contributing
- License
- Acknowledgements
Flappy Bird AI Project leverages computer vision and machine learning techniques to enable an AI agent to play the Flappy Bird game. The project integrates OpenCV for vision processing and TensorFlow for training the AI model, creating an engaging and interactive demonstration of AI capabilities in gaming.
- Real-time Gameplay: AI plays the Flappy Bird game in real-time.
- Computer Vision Integration: Uses OpenCV for processing game visuals.
- AI Training: TensorFlow model trained to navigate the bird through obstacles.
- Interactive GUI: Built with Pygame for a seamless gaming experience.
Follow these steps to set up the project on your local machine:
-
Clone the Repository:
git clone https://github.com/Blacksujit/FlappoBird_interview_round.git cd flapp-bird
-
Install Dependencies:
pip install -r requirements.txt
-
Download Pre-trained Model:
- Download the pre-trained model from here and place it in the
model
directory.
- Download the pre-trained model from here and place it in the
To start the game and watch the AI in action, run the following command:
python play.py
python train.py
1.) Spacebar: Start the game
2.) Esc: Quit the game
1.) Python: Programming language
2.) Pygame: Game development
3.) OpenCV: Computer vision processing
4.) TensorFlow: Machine learning (Neural Networks tarining to make it a model in the gameplay)
5.) NumPy: Numerical computations
We welcome contributions to enhance this project! Please fork the repository and create a pull request with your changes. Make sure to follow the contribution guidelines and maintain code quality.
This project is licensed under the MIT License - see the LICENSE file for details.
1.) Inspired by the classic Flappy Bird game.
2.) Thanks to the open-source community for their invaluable resources.