https://github.com/callahat/dungeon_crawl
Phoenix App, game engine, 2d dungeon. Create your own maps with customizable scripted tiles or use many of the readymades to build puzzles.
https://github.com/callahat/dungeon_crawl
elixir phoenix phoenix-framework rogue-like
Last synced: 5 months ago
JSON representation
Phoenix App, game engine, 2d dungeon. Create your own maps with customizable scripted tiles or use many of the readymades to build puzzles.
- Host: GitHub
- URL: https://github.com/callahat/dungeon_crawl
- Owner: callahat
- Created: 2019-04-11T11:23:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-11-09T03:07:01.000Z (8 months ago)
- Last Synced: 2025-11-09T05:25:37.628Z (8 months ago)
- Topics: elixir, phoenix, phoenix-framework, rogue-like
- Language: Elixir
- Homepage:
- Size: 5.22 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# DungeonCrawl
[](https://github.com/callahat/dungeon_crawl/actions/workflows/ci.yml)
This is a retro style top down multiplayer client/server game engine. The application
acts as the server (which can be networked or just run locally) and the gameplay
takes place in a web browser. Greatly inspired by ZZT this project is an attempt
to recreate some of the simplistic experiences of character driven graphic games.
## Running Via Docker (for development)
For those who prefer to not install all sorts of dependencies on their development system Docker may be used.
To start the app server container and postgres container, run:
`docker compose up`
#### Additional helpful commands
To launch an interactive iex shell running the app (with the ability to run and hit the application server at some point) run:
`docker compose run --rm --service-ports dcrawl`
Or to run a bash shell (and allow iex to be started manually) start postgres then run app:
```
docker compose run --service-ports --use-aliases --rm -d postgres
docker compose run --rm --use-aliases --publish 4000:4000 app bash
```
(The app service route, for the first time you will need to run `docker/init.sh` manually to get erlang, elixir, node, etc)
If its your first time, this can be a lengthy process if building the image.
To clear destroy the containers and remove the dcrawl image:
`docker compose down --rmi local`
To also remove all the volumes (ie, delete all the DB data, downloaded mix deps, etc)
`docker volume rm dungeon_crawl_asdf dungeon_crawl_build dungeon_crawl_deps dungeon_crawl_node dungeon_crawl_postgres dungeon_crawl_static dungeon_crawl_tmp`
## Running
When running docker there are many ways. After setup, simplest is
`docker compose up`
Or, as mentioned above a `docker compose run ...` described above may be uesd. This
could be convenient if needing to also run tests or troubleshoot npm or debug.
The postgres container will need to be running - if running the dcrawl container, this will be started.
If going the `app` service route, be sure to run `docker compose run --rm -d postgres` to start the postgres
container first, otherwise you'll get `DBConnection.ConnectionError` should postgres not be up.
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Running via Local without Containers
There are several dependencies needed. Many of these can be found in the Dockerfile or `init.sh`.
Depending on your local OS installation may differ.
* `asdf` is used for language version management https://github.com/asdf-vm/asdf
* `postgres` is the database used
Other setup
* Install dependencies with `mix deps.get`
* Install Node.js dependencies with `npm install` in the `assets` directory
To Start the app:
`mix phx.server`
or
`iex -S mix phx.server`
to have an interactive shell running with your server. This ties a console to the running
server, and you can also create execute elixir statements without having to start
a separate console.
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Setting up the Database
The database will need setup via `mix ecto.create && mix ecto.load`, or
`mix ecto.create && mix ecto.migrate` if you prefer taking your time.
You'll want to `iex -S mix` and create a super use for yourself, and load the asset seeds.
```elixir
DungeonCrawl.Account.create_admin(%{name: "Admin", username: "Admin", password: , user_id_hash: :base64.encode(:crypto.strong_rand_bytes(24)), is_admin: true})
DungeonCrawl.TileTemplates.TileSeeder.seed_all
DungeonCrawl.Sound.Seeder.seed_all
DungeonCrawl.Equipment.Seeder.seed_all
# You can create a Joinable dungeon with this, or just import one of the json exports in the root path.
DungeonCrawl.Dungeons.generate_dungeon(DungeonCrawl.DungeonGeneration.MapGenerators.ConnectedRooms,
%{autogenerated: false, active: true, name: "Seeded Joinable Dungeon"},
%{width: 40, height: 20},
true)
```
## Existing Games
"Mainline" and "Chore Simulator" JSON exports have been moved to a separate repository.
https://github.com/callahat/dungeon_crawl_games
## Learn more
Ready to run in production? Please [check our deployment guides](http://www.phoenixframework.org/docs/deployment).
* Official website: http://www.phoenixframework.org/
* Guides: http://phoenixframework.org/docs/overview
* Docs: https://hexdocs.pm/phoenix
* Mailing list: http://groups.google.com/group/phoenix-talk
* Source: https://github.com/phoenixframework/phoenix