Giter VIP home page Giter VIP logo

flappy_gp's Introduction

screen-gif

flappy_gp

Description

Flappy bird game using genetic programming. The population are randomly initialized, and the bird who gone the fardest is the one to populate the next gen.

A little probabilistic mutation is added and all the config can be seen in config.txt file. The objective is to learn how to play the game by itself.

When the population is extinct, a new generation is formed based on the best bird who better adapt. When she learns how to play, she'll never make a mistake!

How it works

The initial population are randomly initialized, and the bird who gone the fardest is the one to populate the next gen. One of the tubes height is randomly generated and the counterpart is X pixels of distance from the first one. The current value of X, is the lowest that I put and the bird learned how to pass through. A value lower than this, with the jump phisics, is not possible to traverse it. A little probabilistic mutation is added and all the config can be seen in config.txt file.

Tested with python 3.x and pip 21.x

Dependencies:

  • pygame:
pip install pygame
  • neat:
pip install neat-python

To run

```
python main.py
```

TODO

  • add other types of obstacles and actions for the bird to decide when and where to use them.

flappy_gp's People

Contributors

dodonut 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.