{"id":20088262,"url":"https://github.com/alexistm/flappynet","last_synced_at":"2025-07-25T05:39:34.643Z","repository":{"id":150829549,"uuid":"103743797","full_name":"AlexisTM/FlappyNet","owner":"AlexisTM","description":"Flappybird played by neural network","archived":false,"fork":false,"pushed_at":"2017-09-27T13:19:29.000Z","size":77,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-02T14:48:43.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexisTM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-09-16T10:22:46.000Z","updated_at":"2020-12-31T08:49:47.000Z","dependencies_parsed_at":"2023-04-14T12:52:50.859Z","dependency_job_id":null,"html_url":"https://github.com/AlexisTM/FlappyNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexisTM/FlappyNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2FFlappyNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2FFlappyNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2FFlappyNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2FFlappyNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexisTM","download_url":"https://codeload.github.com/AlexisTM/FlappyNet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2FFlappyNet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266962340,"owners_count":24012996,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T16:13:00.134Z","updated_at":"2025-07-25T05:39:34.635Z","avatar_url":"https://github.com/AlexisTM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlappyNet\nFlappybird played by neural network\n\n# The game\n\nTo play:\n\n```javascript\nvar game;\nwindow.onload = function() {\n\tgame = new Game(60, true)\n\tgame.start();\n\n\tdocument.body.onkeyup = function(e){\n\t\tif(e.keyCode == 32){\n\t\t\tgame.jump();\n\t\t}\n\t\tif(e.keyCode == 13){\n\t\t\tgame.jump();\n\t\t}\n\t\tif(e.keyCode == 82){\n\t\t\tgame.reset();\n\t\t}\n\t}\n\tsetInterval(function(){game.update()}, 17);\n}\n```\n\nTo use it with machine learning:\n\n```javascript\n// Game instanciation\n// 60fps, no visuals, will be ran faster. \ngame = new Game(60, false); \ntraining = true;\n\n// While training\nwhile(training) {\n\t// While the game is not lost\n\twhile(!game.lost) {\n\t\tgame.update()\n\t\t\n\t\tlet flappy = game.flappy; // flappy.velocity, flappy.altitude, flappy.position\n\t\tlet grid = game.occupancy; // grid of width/60 x height/60, 0: no obstacle, 1: obstacle\n\n\t\tlet output = infer_network(flappy, grid);\n\t\tif(output \u003e 0.5)\n\t\t\tgame.jump();\n\t}\n\tlet score = game.score;\n\t// Compare score to other generations and evolve.\n\n\tgame.reset()\n\t// play again with the new genome\n}\n\n```\n\n# Neural net\n\nNot yet implemented. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexistm%2Fflappynet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexistm%2Fflappynet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexistm%2Fflappynet/lists"}