{"id":18049638,"url":"https://github.com/iacobson/ecspanse_demo","last_synced_at":"2025-04-05T06:15:20.584Z","repository":{"id":186503993,"uuid":"675280639","full_name":"iacobson/ecspanse_demo","owner":"iacobson","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-22T20:25:00.000Z","size":217,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T02:36:54.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/iacobson.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}},"created_at":"2023-08-06T11:58:17.000Z","updated_at":"2024-07-20T15:33:03.000Z","dependencies_parsed_at":"2023-12-22T18:36:26.572Z","dependency_job_id":null,"html_url":"https://github.com/iacobson/ecspanse_demo","commit_stats":null,"previous_names":["iacobson/ecspanse_demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2Fecspanse_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2Fecspanse_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2Fecspanse_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iacobson%2Fecspanse_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iacobson","download_url":"https://codeload.github.com/iacobson/ecspanse_demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294567,"owners_count":20915341,"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":[],"created_at":"2024-10-30T21:08:19.534Z","updated_at":"2025-04-05T06:15:20.558Z","avatar_url":"https://github.com/iacobson.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ecspanse Demo\n\nThis is the code used in the [Ecspanse Tutorial](https://hexdocs.pm/ecspanse/tutorial.html).\n\n[Ecspanse](https://hexdocs.pm/ecspanse/Ecspanse.html) is a an [Entity Component System](https://en.wikipedia.org/wiki/Entity_component_system) library for Elixir.\n\n## Installation\n\n- clone the repo\n- install dependencies with `mix deps.get`\n\n## Running the API Functions in the IEX Console\n\n- start the app with `iex -S mix`\n\nThen:\n\n- fetch the hero details\n\n```iex\niex(1)\u003e Demo.API.fetch_hero_details()\n```\n\n- move the hero\n\n```iex\niex(2)\u003e Demo.API.move_hero(:up)\n```\n\netc. See the functions in the `Demo.API` module for more details.\n\n## Running the Demo in LiveBook\n\n- you need to have elixir [LiveBook](https://livebook.dev/) installed\n- start the livebook\n- start the Demo ap with the `sname` and `cookeie` options, like: `iex --sname demo  --cookie cookie -S mix`\n\n- open the livebook\n\n  - open\n  - from file\n  - browse to `./ecspanse_demo/livebook/`\n  - select `demo.livemd`\n  - open\n\n- connect the livebook to the running demo app\n  - in the left menu select the `Runtime settings`\n  - configure\n  - attach node\n  - add the `name` and `cookie` you set when starting the demo app\n  - connect\n- the app should be now connected and you can evaluate the code in the livebook\n- the two sections should be available: Hero and Market. Enable the keyboard control and use the arrow keys to move the hero and collect resources. Use the resources to purchase items from the shop and see them in the hero inventory.\n\n![hero](./livebook/hero.png)\n![market](./livebook/market.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiacobson%2Fecspanse_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiacobson%2Fecspanse_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiacobson%2Fecspanse_demo/lists"}