Code Royale is an exhilarating online coding battle royale game where players compete in real-time to solve programming challenges and be the last one standing.

How it Works

Players join a game lobby, and once the game starts, they are presented with coding problems. Using the in-browser Monaco editor, participants write and submit their solutions. The backend, built with C# ASP.NET Core, receives the code and sends it to a custom cloud server to compile and evaluate its output against a series of test cases.

The game features real-time updates via WebSockets, allowing players to see who is still in the game. Players have HP and, if unable to solve a problem, will lose HP.

Key Features

Real-time Multiplayer: Compete against others in a fast-paced coding environment.
In-Browser Code Editor: Write and test your code directly in the web interface, powered by Monaco Editor.
Automated Code Judging: Submissions are automatically assessed for correctness and efficiency.
Lobby System: Create new game rooms or join existing ones using a room code.
Problem Display: Clear presentation of problem statements, input/output formats, constraints, and example test cases within the game window.
Live Feedback: A terminal-like interface provides immediate feedback on code submissions, including compilation errors, runtime errors, and test case results.

Technology Stack

Frontend: Next.js, React, TypeScript, Tailwind CSS
Backend: C# ASP.NET Core, with WebSockets for real-time communication.
Code Execution: Custom cloud compiler
Development: Monorepo managed with Turborepo, using Bun as a runtime and package manager.

In the future, we would like to improve upon this project by adding problems with higher difficulty to attact a wider playerbase. We could also include a "cosmetic shop" for players to purchase custom IDE themes for the game.

Share this project:

Updates