{"id":16024345,"url":"https://github.com/axelson/scenic_asteroids","last_synced_at":"2025-08-27T07:07:34.436Z","repository":{"id":44102736,"uuid":"151979398","full_name":"axelson/scenic_asteroids","owner":"axelson","description":"A toy Asteroids clone written in Elixir with the Scenic UI library","archived":false,"fork":false,"pushed_at":"2024-11-10T19:31:04.000Z","size":2793,"stargazers_count":46,"open_issues_count":8,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-11T08:54:49.103Z","etag":null,"topics":["elixir","example","game","nerves"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axelson.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":"2018-10-07T19:51:29.000Z","updated_at":"2025-02-16T06:32:19.000Z","dependencies_parsed_at":"2024-10-27T15:20:48.428Z","dependency_job_id":"12e40d02-b50c-4ef3-b642-2c06def5d5d5","html_url":"https://github.com/axelson/scenic_asteroids","commit_stats":{"total_commits":216,"total_committers":3,"mean_commits":72.0,"dds":0.03703703703703709,"last_synced_commit":"20fb22af441028b0837016337c5e418c033ded29"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fscenic_asteroids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fscenic_asteroids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fscenic_asteroids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelson%2Fscenic_asteroids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelson","download_url":"https://codeload.github.com/axelson/scenic_asteroids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871364,"owners_count":20361339,"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":["elixir","example","game","nerves"],"created_at":"2024-10-08T19:06:34.517Z","updated_at":"2025-03-17T16:30:49.114Z","avatar_url":"https://github.com/axelson.png","language":"Elixir","readme":"![Scenic Asteroids Logo](asteroids_r2_full.png)\n\n# Scenic Asteroids\n\n![Demo of Gameplay](game_demo.gif)\n\nThis is an Asteroids clone written in Elixir with Nerves, more for fun and\nlearning than for anything else. Also since the code (and behavior) is\nrelatively simple, I hope that it can serve as an example for Scenic, Nerves,\nand as a simple [poncho\nproject](https://embedded-elixir.com/post/2017-05-19-poncho-projects/).\n\nIt is licensed under the 3-clause BSD license (see LICENSE) for details.\n\n## Instructions\n\nFrom the root of the repository run the following commands:\n* Install [scenic pre-requisites](https://github.com/boydm/scenic_new#install-prerequisites)\n* `cd play_ui`\n* `mix deps.get`\n* `iex -S mix`\n\nNote: if scenic doesn't launch then you may be affected by the bug https://github.com/boydm/scenic_new/issues/36\n\nKeys:\n* `W` - Move up\n* `A` - Move left\n* `S` - Move down\n* `D` - Move right\n* `SPC` - Shoot an asteroid\n\nUse the mouse to target the asteroids (or your finger if you're running with a\nNerves touch screen)\n\nHave fun!\n\n## Implementation Notes\n\n[SchedEx](https://github.com/SchedEx/SchedEx) is used to implement the core\nanimation timer which runs at a rate of 60 frames per second.\n\nCollision detection is incredibly basic and non-performant. Ideally either\nscenic or a cooperating library would implement some collision detector helpers.\nIf you're interested in collision detection then please contribute to Scenic\n[issue #91](https://github.com/boydm/scenic/issues/91).\n\n# Projects\n\n* `play/` - The main game logic\n* `play_ui/` - Run via scenic on the desktop\n* `fw/` - Run on a Nerves device with a touchscreen\n  * Official Raspberry PI touch screen is supported\n\n# JS Multiplayer (in progress)\n\nTODO:\n* [x] Get basic nerves install working on network\n* [x] Run scenic play application on nerves!\n* [ ] Add multiplayer via Phoenix channels\n  * [ ] Add single player control via browser\n  * [ ] Ask for player name\n  * [ ] Add a waiting screen/lobby\n* [ ] Splash screen add option to choose single player or multiplayer\n  * Logo will come down and then the options appear\n  * [ ] Pressing \"SPC\" or \"s\" will start single player immediately\n  * [ ] Pressing \"m\" will start multi player immediately\n* [ ] Test possibility of rendering the current scene to an html canvas\n\nThe player javascript will record action states (not key states)\nActions:\n* move_aim_direction (vector)\n  * Note: This will also be used for aiming direction\n* move_up\n* move_right\n* move_down\n* move_left\n* aim_direction (vector)\n* shoot\n\nNOTE: if `move_aim_direction` is used then the other move and aim actions should\nnot be used. This will be enforced on the server-side.\n\n* Channel actions\n  * `set:actions`\n    * When the channel receives this it will do a `GenServer.cast` to the Asteroids scene to update that players currently set actions\n    * If the channel process goes down, the scene will clear all actions for that player\n      * Perhaps this can be accomplished with a process link?\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelson%2Fscenic_asteroids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelson%2Fscenic_asteroids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelson%2Fscenic_asteroids/lists"}