An online Tetris battle royale where 99 players compete until only one remains, built with Elixir and Phoenix to showcase the power of functional, real-time programming for multiplayer games.
- Battle Royale: 99 players compete in a last-player-standing match.
- Multiplayer Attacks: Send "garbage" lines to opponents by clearing multiple lines at once.
- Targeting System: Manually aim at specific players or use automatic strategies (Random, Attackers, Badges, KOs).
- Real-time & Low Latency: Optimized for responsive, instantly synchronized gameplay.
- Elixir (~> 1.15) - A functional language perfect for concurrent systems.
- Phoenix (~> 1.7) - A robust web framework for real-time applications.
- Phoenix LiveView - For reactive, real-time user interfaces.
- Phoenix PubSub - Messaging system for player communication.
- Ecto - For data persistence.
- SQLite3 - Lightweight database for easy setup.
- Tailwind CSS - For a modern, responsive UI.
- Elixir & Erlang: Official Installation Guide
- We recommend using a version manager like asdf-vm for development.
- Node.js: Required for asset compilation. Download here.
git clone https://github.com/pupunha-code/tetris-pupunha.git
cd tetris-pupunhaThis single command fetches all Elixir and Node.js dependencies.
mix deps.getThis creates and seeds the database.
mix ecto.setupCompile the frontend assets (Tailwind CSS and JavaScript).
mix assets.buildStart the Phoenix server.
mix phx.serverOr, to run inside an interactive Elixir shell:
iex -S mix phx.serverThe application will be running at http://localhost:4000.
- Run Tests:
mix test - Reset the Database:
mix ecto.reset
- Deploy Assets for Production:
mix assets.deploy
All real-time communication between the client and server follows a specific WebSocket protocol. For details on the implementation and how to interact with the game channels, please see the Game Protocol Document.
The video below demonstrates the current state of the game's core mechanics, including piece movement, rotation, and line clearing. Multiplayer features are under active development.