Bubble Wrap simulator for the Global Game Jam 2025.
Using a phoenix server to communicate between a godot host (game logic and visuals) and a web client for mobile (controls)
- The game consists of:
- The networking server, written in Elixir (+ Phoenix).
- The main game shown on the main screen, written in Godot.
- A HTML (+ a sprinkle of JS) web client, served by the Elixir/Phoenix app
- Install Godot by following https://godotengine.org/
- Install Elixir by following https://elixir-lang.org/install.html
Open the folder bubbleserver and in here run mix setup to compile the Elixir app for the first time.
Then, run mix phx.server to run the Elixir server app.
It will run on localhost:4000 by default.
Separately, open the folder game. This is a Godot project.
To make Godot know where the Elixir app is running:
- copy the file
.env.exampleto.env(this.envfile is intentionally not tracked by git)- To connect to the locally-running Elixir server, fill in
ws://localhost:4000/socket - To connect to the remotely-running Elixir server, fill in
wss://bubbleserver.fly.dev/socket(or e.g.wss://yourdomain.com/socket) (Note thewss://with the extra s!)
- To connect to the locally-running Elixir server, fill in
- From the
bubbleserverdir, runmix phx.server - From the
gamedir, start and run the Godot project.
When running Godot while the Elixir app is running, it will try to connect to the Elixir app. Check its logs for details.
We're running an instance of the Elixir service on http://fly.io
Installation guide for the fly CLI program: https://fly.io/docs/flyctl/install/
(If you're not part of Snappy Cobra and would like to run a version of the program yourself on Fly,
run fly launch from the bubbleserver subdirectory.)
- To deploy, run
fly deploy - To view the live logs, run
fly logs
If you have trouble installing Elixir or some of the app's dependencies on your host OS (Some Windows installs have this), you can alternatively use Docker.
- Be sure Docker is installed and the Docker daemon is running
- Go to the
bubbleserverdirectory - Run
docker build -t bubbleserver -f Dockerfile.dev .to build a dev-version of the app image -
- Run
docker run -p 4000:4000 bubbleserverto start the app image. It should be reachable at localhost:4000 just like normal.
- Run