A turn-based browser RPG built with Phoenix LiveView
See the codeA turn-based RPG built with Phoenix LiveView, online since 2020.
PRESS STARTStack: Elixir 1.16 · Phoenix 1.7 · LiveView 0.20 · PostgreSQL
Gameplay: 20 avatars · 20+ skills · 25+ items · 7 league tiers · 1v1 duels · 5v5 matches
Game orchestrates all gameplay modules. Engine orchestrates all battle-related modules. Both use defdelegate to expose clean public APIs.
flowchart LR
Moba --> Game & Engine
Game --> Heroes & Training & Arena & Items
Engine --> Battles & Processor & Spell & Effect
Key files:
lib/moba.ex — Cross-domain orchestrationlib/moba/game.ex — Gameplay orchestratorlib/moba/engine.ex — Battle orchestratorSkills and items are defined as chains of small, pure effect functions. The Spell module uses pattern matching as a DSL for skill definitions.
flowchart LR
A[Skill Cast] --> B[Spell]
B -->|pattern match| C[Effect Chain]
C --> D[Updated Turn]
Key files:
lib/moba/engine/core/processor.ex — Turn processing pipelinelib/moba/engine/core/spell.ex — Skill/item definitions via pattern matchinglib/moba/engine/core/effect.ex — Composable effect functionsWhy this pattern:
mix deps.get
mix ecto.setup
cd assets && npm install && cd ..
mix phx.server
Visit localhost:4000. Admin login: admin@browsermoba.com / 123456
MIX_ENV=test mix ecto.setup
mix test
Elixir
54.7%
HTML
30.7%
CSS
8.5%
SCSS
3.8%
JavaScript
2.4%
A turn-based browser RPG built with Phoenix LiveView
See the codeA turn-based RPG built with Phoenix LiveView, online since 2020.
PRESS STARTStack: Elixir 1.16 · Phoenix 1.7 · LiveView 0.20 · PostgreSQL
Gameplay: 20 avatars · 20+ skills · 25+ items · 7 league tiers · 1v1 duels · 5v5 matches
Game orchestrates all gameplay modules. Engine orchestrates all battle-related modules. Both use defdelegate to expose clean public APIs.
flowchart LR
Moba --> Game & Engine
Game --> Heroes & Training & Arena & Items
Engine --> Battles & Processor & Spell & Effect
Key files:
lib/moba.ex — Cross-domain orchestrationlib/moba/game.ex — Gameplay orchestratorlib/moba/engine.ex — Battle orchestratorSkills and items are defined as chains of small, pure effect functions. The Spell module uses pattern matching as a DSL for skill definitions.
flowchart LR
A[Skill Cast] --> B[Spell]
B -->|pattern match| C[Effect Chain]
C --> D[Updated Turn]
Key files:
lib/moba/engine/core/processor.ex — Turn processing pipelinelib/moba/engine/core/spell.ex — Skill/item definitions via pattern matchinglib/moba/engine/core/effect.ex — Composable effect functionsWhy this pattern:
mix deps.get
mix ecto.setup
cd assets && npm install && cd ..
mix phx.server
Visit localhost:4000. Admin login: admin@browsermoba.com / 123456
MIX_ENV=test mix ecto.setup
mix test
Elixir
54.7%
HTML
30.7%
CSS
8.5%
SCSS
3.8%
JavaScript
2.4%