Thanks to visit codestin.com
Credit goes to github.com

Skip to content
forked from 0xPr0f/whottos

A modern Whot card game with Cloudflare Workers and Durable Objects, featuring AI battles or real-time multiplayer with PWSDORS (Persistent WebSocket Durable Object Room System)

Notifications You must be signed in to change notification settings

gishmel/whottos

 
 

Repository files navigation

Whot Card Game

A classic Whot card game implemented using Next.js, featuring advanced real-time multiplayer capabilities through Cloudflare agents and durable objects.

Technologies Used

  • Next.js: A React framework for building server-rendered applications, providing a robust foundation for the frontend.
  • Cloudflare Workers: Serverless computing platform used for backend logic, including game AI and room management.
  • Cloudflare Durable Objects: Stateful objects for persistent storage, crucial for maintaining game room states.
  • WebSockets: Protocol for real-time, bidirectional communication between clients and servers, essential for multiplayer synchronization.
  • PWSDORS (Persistent WebSocket Durable Object Room System): A custom system for persistent, real-time multiplayer rooms, leveraging WebSockets and Durable Objects.

Technical Overview

Architecture

  • Frontend: Next.js application handling user interface and interactions.
  • Backend: Cloudflare Workers managing game logic, AI, and room persistence via Durable Objects.
  • Real-Time Communication: WebSockets ensuring instant updates and synchronization across players.

Features

  • Multiplayer Mode: Real-time play against friends with synchronized game states.
  • AI Opponent: Advanced AI for single-player mode, implemented using Cloudflare agents.
  • Persistent Rooms: Rooms that maintain state even after player disconnection, allowing seamless rejoining.
  • State Synchronization: Ensures all players have a consistent view of the game state.

PWSDORS Explanation

PWSDORS (Persistent WebSocket Durable Object Room System) is a proof of concept developed by Prof oz. It uses WebSockets for real-time communication and Cloudflare Durable Objects to create and manage persistent rooms. Each room can have multiple members, and their states are synchronized in real-time. This system is crucial for enabling multiplayer features in the Whot card game, allowing players to join rooms, play together, and have their game states consistently updated across all participants.

Getting Started

Prerequisites

  • Node.js
  • npm, yarn, pnpm, or bun

Setup

  1. Clone the repository:
git clone https://github.com/0xPr0f/whottos.git
  1. Navigate to the project directory:
cd whottos
  1. Install dependencies:
pnpm install  # or yarn, npm, bun
  1. Start the development server:
pnpm dev  # or yarn dev, npm run dev, bun dev
  1. Open http://localhost:3000 in your browser.

About

A modern Whot card game with Cloudflare Workers and Durable Objects, featuring AI battles or real-time multiplayer with PWSDORS (Persistent WebSocket Durable Object Room System)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.8%
  • CSS 1.1%
  • JavaScript 0.1%