Git Product home page Git Product logo

flappybirdspygame's Introduction

Flappy Birds

Implementation of the game Flappy Birds with genetic algorithm using Tensorflow as Neural Net and pygame as Gui.

Usage & Functionality

First you have to install the required packages. To run the game you have to create an Object of the Game() class.

game = Game(human=False, algorithm=0, algorithm_random=0, ai=3)

The possible parameter are human Boolean for a human controlled player, algorithm Integer for the amount of algorithm controlled player(the algorithm makes no mistakes), algorithm_random Integer for the amount of players with the base functionality of the previous algorithm plus some random moves to make it not flawless and ai Integer with the amount of players controlled by an random initialized ai.

The human and randomized-algorithm player will regenerate as soon as they die in a "playable" position. The ai player generates in "generations" meaning it will wait till all current players have died and depending of their living times will the best models regenerate with some small tweaks in their weights. This enables the possibility to generate a very good to flawless model with a very small amount of players and generations (in the video 3 players and 8 generations).

Ai learning:

Learning Ai

The video is buffering/freezing due to insufficient processing power on my laptop.

Contributing

While the current code is fairly functional, it could benefit from the following contributions:

  • adding a good looking GUI (Pictures to include instead of circles and rectangles)
  • saving the generated ai models
  • adding game and GUI functionality by implementing more buttons for the generation of new players and maybe end conditions to end the game if a certain player dies

flappybirdspygame's People

Contributors

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