Skip to content

feat: implement multiplayer mode - #25

Merged
diiabblo merged 15 commits into
mainfrom
feat/multiplayer-mode
Feb 12, 2026
Merged

feat: implement multiplayer mode#25
diiabblo merged 15 commits into
mainfrom
feat/multiplayer-mode

Conversation

@diiabblo

Copy link
Copy Markdown
Owner

Summary

Implements real-time multiplayer trivia battles with room creation, live leaderboards, chat functionality, and prize pool distributions.

Changes

  • Added multiplayer type definitions and room configurations
  • Created useGameRooms, useGameRoom, and useRoomChat custom hooks
  • Implemented multiplayer UI components (RoomCard, RoomList, PlayerList, RoomChat, CreateRoomModal, LiveLeaderboard)
  • Added multiplayer constants with prize distribution logic
  • Created dedicated multiplayer page with room browser
  • Added comprehensive documentation

Features

  • Room System: Create and join custom game rooms (2-10 players)
  • Live Leaderboard: Real-time player rankings during games
  • Chat Integration: In-room chat for player communication
  • Prize Pools: Entry fees accumulate into distributed prizes
  • Room Filters: Browse by status, players, category
  • Real-Time Updates: Automatic polling for live synchronization
  • Player States: Waiting, Ready, Playing, Finished tracking
  • Room Configuration: Customizable players, questions, categories, entry fees

Room Configuration Options

  • Room Name: Custom identifier
  • Max Players: 2-10 participants
  • Questions: 5-20 per game
  • Category: Specific or mixed topics
  • Entry Fee: 0-10,000 points
  • Time Limits: Per-question constraints

Prize Distribution

2 Players:  1st: 70%, 2nd: 30%
3 Players:  1st: 50%, 2nd: 30%, 3rd: 20%
4+ Players: 1st: 50%, 2nd: 30%, 3rd: 20%

Scoring System

Answer Score = Base (100) + Time Bonus (0-50)
Time Bonus = (timeRemaining / timeLimit) * 50

Components Added

  • RoomCard: Individual room display with details
  • RoomList: Grid of available rooms
  • PlayerList: Room participants with ready states
  • RoomChat: Real-time messaging system
  • CreateRoomModal: Room creation interface
  • LiveLeaderboard: Real-time rankings during gameplay

Closes #5

@diiabblo
diiabblo merged commit 8633761 into main Feb 12, 2026
4 of 19 checks passed
@diiabblo
diiabblo deleted the feat/multiplayer-mode branch February 12, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add multiplayer mode

1 participant