{"id":15668312,"url":"https://github.com/devstopfix/elixoids","last_synced_at":"2025-05-06T19:48:24.302Z","repository":{"id":51386859,"uuid":"59416130","full_name":"devstopfix/elixoids","owner":"devstopfix","description":"Asteroids game engine written in Elixir","archived":false,"fork":false,"pushed_at":"2023-05-27T18:26:54.000Z","size":4823,"stargazers_count":9,"open_issues_count":11,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-03T08:24:13.249Z","etag":null,"topics":["elixir","game-server"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devstopfix.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":"2016-05-22T14:18:25.000Z","updated_at":"2024-05-30T23:42:59.000Z","dependencies_parsed_at":"2024-10-23T09:53:54.483Z","dependency_job_id":"a3549cbc-3669-42ba-835e-6f4c23bc11bc","html_url":"https://github.com/devstopfix/elixoids","commit_stats":{"total_commits":540,"total_committers":4,"mean_commits":135.0,"dds":"0.27222222222222225","last_synced_commit":"7d61bded53c4793cc82aa0abd86b34bccf780d8e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Felixoids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Felixoids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Felixoids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Felixoids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devstopfix","download_url":"https://codeload.github.com/devstopfix/elixoids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252758452,"owners_count":21799850,"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","game-server"],"created_at":"2024-10-03T14:08:01.852Z","updated_at":"2025-05-06T19:48:24.270Z","avatar_url":"https://github.com/devstopfix.png","language":"JavaScript","readme":"# Elixoids\n\n[Asteroids 1979 arcade game][1] engine written in [Elixir][2]. Watch the [Elixoids movie][6] on [Vimeo](https://vimeo.com) recorded at a Coding Night. Participants were given one hour to write an AI bot that could pilot a ship and play the game! See the original [Arcade Asteroids video](https://www.youtube.com/watch?v=WYSupJ5r2zo).\n\n[![Elixoids](docs/elixoids-8fps.gif)][6] [![Elixoids](docs/elixoids.vimeo.JPG)][6]\n\nThe original UI was rendered by [JavaScript asteroids-ui][3] and has had a recent [Elm conversion](ui/elm/README.md). Audio originall provided by [SonicAsteroids][4] before conversion to [Web Audio][8].\n\n[![Build Status](https://github.com/devstopfix/elixoids/workflows/ci/badge.svg)](https://github.com/devstopfix/elixoids/actions)\n\n\n## Build\n\nTo run the game [on Ubuntu](docs/ubuntu.md), or on OSX:\n\n    brew install elixir\n    git clone https://github.com/devstopfix/elixoids.git\n    cd elixoids\n    mix deps.get\n\n## Run\n\nThis repo contains the game engine, a webserver, and a recent version of the [asteroids-ui](ui/elm/README.md).\n\nTo start a game use the [play script](bin/play.sh) or:\n\n    mix run --no-halt\n\nOpen the UI in your browser:\n\n    open http://localhost:8065/0/game\n\nIn the REPL you can start multiple games on the same server:\n\n```elixir\niex -S mix\n\n{:ok, pid, id} = Elixoids.Game.Supervisor.start_game([asteroids: 16])\n{:ok, #PID\u003c0.538.0\u003e, 2}\n```\n\n```bash\nopen http://localhost:8065/2/game\npython3 clients/miner.py --name TWO --game 2\n```\n\nThe parameters of the game can be alterted in the [config](config/config.exs).\n\n## Clients\n\nClients subscribe to an event stream from the game via Websockets. The resources available are:\n\n| Path               | Accept                   | Content                   |\n| ------------------ | ------------------------ | ------------------------- |\n| `/0/graphics`      | application/json         | Graphics stream           |\n| `/0/news`          | text/event-stream        | News stream               |\n| `/0/ship/PLY`      | application/json         | Game state for player PLY |\n\n### News Client\n\nThe news stream at `http://example.com/0/news` is a stream of text lines of the form:\n\n    [PLY|ASTEROID] VERB [PLY|ASTEROID]\n\nExample dialogue:\n\n```bash\n$ curl -H 'Accept: text/event-stream' http://localhost:8065/0/news 2\u003e\u00261\n\nPLY fires\nPLY shot ASTEROID\nPLY fires\nPLY shot OTH\nPLY kills OTH\nASTEROID hit PLY\nASTEROID spotted\n```\n\nThis can be used to generate a hi-score table:\n\n    elixir --no-halt clients/hiscore.exs http://localhost:8065/0/news\n\n### Java Ship Client\n\nSee [Elixoids Java Client](https://github.com/jrothwell/asteroids-client) by [J Rothwell][5].\n\n### Python Asteroid Miner Client\n\nThe [CBDR](https://en.wikipedia.org/wiki/Constant_bearing,_decreasing_range) Python client at [miner.py](clients/miner.py) will try and shoot the asteroid which is on the most constant bearing with it:\n\n    pip3 install websocket-client --user\n    python3 clients/miner.py --host localhost:8065 --name MCB\n\n### Ruby Client\n\nThere is a simple Ruby client that [shoots the nearest ship](clients/shoot_nearest_ship.rb):\n\n    gem install eventmachine\n    gem install faye-websocket\n\n    export ELIXOIDS_SERVER=rocks.example.com:8065 ruby clients/shoot_nearest_ship.rb\n\nNB The websocket connection can be *troublesome* on OSX. It will often fail to connect after a reboot. Keep trying and it will eventually connect and stay connected! These scripts will be migrated to Python3.\n\n### Graphics Client\n\nGraphics stream can be received at `ws://example.com/0/graphics` - to be documented - see [GraphicsDecoder.elm](ui/elm/src/GraphicsDecoder.elm) and [asteroids-ui][3] for reference implementations.\n\nWhile developing the UI you can start a [test card](docs/testcard-classic.jpg) game that allows you to prove your rendering:\n\n    mix run --no-halt games/testcard.exs\n\nThen connect to `ws://localhost:8065/1/game`.\n\n## Deploy\n\nSee the [Ubuntu deployment guide](docs/ubuntu.md) to run the game engine on a server.\n\n## Licence\n\nThis software is published under the [MIT License](LICENSE) and Copyright ©2019 [devstopfix](https://www.devstopfix.com). UI is ©2016 [lachok](https://github.com/lachok). Audio code is ©2016 [jrothwell][5]. Button CSS by [ozer][7].\n\n[1]: https://en.wikipedia.org/wiki/Asteroids_(video_game)\n[2]: http://elixir-lang.org/\n[3]: https://github.com/lachok/asteroids\n[4]: https://github.com/jrothwell/sonic-asteroids\n[5]: https://github.com/jrothwell\n[6]: https://vimeo.com/330017229\n[7]: https://codepen.io/ozer/pen/KwvKoR\n[8]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevstopfix%2Felixoids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevstopfix%2Felixoids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevstopfix%2Felixoids/lists"}