Giter Club home page Giter Club logo

flappy-bird's Introduction

Neural Network Flappy Bird

This project is an implementation of the popular game Flappy Bird, with a twist. Instead of being controlled by a human player, the bird in this game is controlled by a neural network. The neural network is trained using a genetic algorithm, with each generation of birds learning from the previous one.

Overview

The bird's neural network takes as input the bird's current position and velocity, as well as the position of the next pipe. It outputs a two values, which determines whether the bird should flap its wings and move upwards.

The genetic algorithm randomly selects the birds, weighted by their fitness, from each generation to breed and produce the next generation. The fitness of a bird is determined by how far it manages to travel without hitting a pipe, ground or ceiling.

Classes

The main classes in this project are:

  • Bird: Represents a bird in the Flappy Bird game.
  • NNBird: A subclass of Bird that is controlled by a neural network.
  • Brain: Represents a neural network model used for prediction and mutation using tensorflow.js.
  • Population: Represents a population of NNBird objects.
  • Pipe: Represents a pipe obstacles in the Flappy Bird game.
  • Pipes: Represents a collection of pipe obstacles in the Flappy Bird game.

Getting Started

  1. Clone the repository.
  2. Navigate to the repository's directory using the terminal.
  3. Type and run the following command into your terminal:
$ python3 -m http.server
  1. Visit http://localhost:8000 on your browser.

flappy-bird's People

Contributors

awakenedhaki avatar

Stargazers

 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.