{"id":27363637,"url":"https://github.com/kokodoko/flappy-evolution","last_synced_at":"2025-09-09T13:44:43.155Z","repository":{"id":287541394,"uuid":"965062662","full_name":"KokoDoko/flappy-evolution","owner":"KokoDoko","description":"Evolving Flappy Birds until they learn how to fly","archived":false,"fork":false,"pushed_at":"2025-04-12T10:47:14.000Z","size":2587,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T11:37:11.626Z","etag":null,"topics":["game-development","javascript","machine-learning","ml5js","neuroevolution"],"latest_commit_sha":null,"homepage":"https://kokodoko.github.io/flappy-evolution/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KokoDoko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-12T10:27:14.000Z","updated_at":"2025-04-12T10:47:17.000Z","dependencies_parsed_at":"2025-04-12T11:50:00.354Z","dependency_job_id":null,"html_url":"https://github.com/KokoDoko/flappy-evolution","commit_stats":null,"previous_names":["kokodoko/flappy-evolution"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KokoDoko%2Fflappy-evolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KokoDoko%2Fflappy-evolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KokoDoko%2Fflappy-evolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KokoDoko%2Fflappy-evolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KokoDoko","download_url":"https://codeload.github.com/KokoDoko/flappy-evolution/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248663643,"owners_count":21141805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-development","javascript","machine-learning","ml5js","neuroevolution"],"created_at":"2025-04-13T04:31:46.381Z","updated_at":"2025-04-13T04:31:48.078Z","avatar_url":"https://github.com/KokoDoko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flappy Evolution\n\n\u003cimg src=\"./images/bird-big.png\" width=\"340\"\u003e\n\n[LIVE DEMO](https://kokodoko.github.io/flappy-evolution/)\n\n### Flappy bird learns to fly by neuro-evolution\n\n- Create a generation of 100 birds with a random brain\n- The brain decides when to flap, based on 5 sensory inputs of the bird\n- After all birds have sadly passed away, pairs of birds that performed best are selected for the next generation\n- Those pairs make children, based on their parents brains, and mutate slightly\n- After 5 ~ 15 generations with a population of ~30, the birds can avoid pipes effectively\n- This demo loads this pre-trained brain into 3 birds\n\n\u003cbr\u003e\u003cbr\u003e\u003cbR\u003e\n\n## ML5 Neural network\n\n### Inputs\n\n- The y-position of the bird\n- The y-velocity of the bird\n- The y-position of the next top pipe’s opening\n- The y-position of the next bottom pipe’s opening\n- The x-distance to the next pipe\n\n\n\n\u003cfigure\u003e\n    \u003cimg width=\"400\" src=\"./images/inputs.png\" alt=\"Diagram of neural network inputs\"\u003e\n    \u003cfigcaption\u003eFive sensory inputs - (The Nature of Code by Daniel Shiffman)\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cbr\u003e\u003cbr\u003e\u003cbR\u003e\n\n### Outputs\n\n- Flap or don't flap\n\n\u003cfigure\u003e\n    \u003cimg width=\"400\" src=\"./images/network.webp\"\u003e\n    \u003cfigcaption\u003eResulting Neural Network (The Nature of Code by Daniel Shiffman)\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cbr\u003e\u003cbr\u003e\u003cbR\u003e\n\n\n### Code\n\n```js\nlet options = {\n    inputs: 5,\n    outputs: [\"flap\", \"no flap\"],\n    task: \"classification\",\n    neuroEvolution: true\n};\nlet brain = ml5.neuralNetwork(options);\n\nlet inputs = [...sensory data here...]\nlet prediction = brain.classify(inputs, (result) =\u003e {\n    console.log(`I think I should %{result[0].label}`)\n})\n\n```\n\u003cbr\u003e\u003cbr\u003e\u003cbR\u003e\n\n\n## Links\n\n- https://natureofcode.com/neuroevolution/\n- https://docs.ml5js.org/#/reference/neural-network\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokodoko%2Fflappy-evolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkokodoko%2Fflappy-evolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokodoko%2Fflappy-evolution/lists"}