Teaching neural networks to flap via natural selection
A pure JavaScript demo that evolves neural networks to play Flappy Bird in real time, complete with a standalone neuroevolution library.

What it does
FlappyLearning is a live browser experiment where a population of neural networks attempts to master Flappy Bird through neuroevolution. The project includes Neuroevolution.js, a standalone library that evolves network weights using genetic algorithms, selecting and mutating birds based purely on survival score.
The interesting bit The library treats weights as genes: each generation breeds, mutates, and culls networks based solely on how long a bird survives. It is a compact, fully client-side illustration of evolutionary computation.
Key highlights
- Pure JavaScript implementation running entirely in the browser
- Configurable perceptron structure, population size, elitism rate, and mutation parameters
Neuroevolution.jsis decoupled from the game logic for reuse in other toy problems- Live demo visualizing each generation’s incremental progress (and frequent crashes)
- 3,993 stars, suggesting it has long served as an accessible entry point into ML
Caveats
- The README is minimal: it documents API options but offers no theory, benchmarks, or maintenance history.
- Code snippets rely on older JavaScript conventions (
var, non-modular scope), so expect a pre-ES6 dialect. - It is strictly a teaching demo, not a general-purpose reinforcement-learning framework.
Verdict Grab it if you want a visual, low-friction introduction to neuroevolution or a seed for browser-based genetic algorithms. Pass if you need production-grade ML tooling or rigorous algorithmic documentation.
Frequently asked
- What is xviniette/FlappyLearning?
- A pure JavaScript demo that evolves neural networks to play Flappy Bird in real time, complete with a standalone neuroevolution library.
- Is FlappyLearning open source?
- Yes — xviniette/FlappyLearning is open source, released under the MIT license.
- What language is FlappyLearning written in?
- xviniette/FlappyLearning is primarily written in JavaScript.
- How popular is FlappyLearning?
- xviniette/FlappyLearning has 4k stars on GitHub.
- Where can I find FlappyLearning?
- xviniette/FlappyLearning is on GitHub at https://github.com/xviniette/FlappyLearning.