Skip to content
fortunesayspumpPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

96 Commits

Folders and files

Repository files navigation

Whot Go! ๐Ÿƒ

The Ultimate African Card Game Experience on Solana

Whot Go! is a modern, blockchain-powered implementation of the classic African card game "Whot" (also known as "Wot" or "Wot Card"). Built on Solana with Honeycomb Protocol integration, it brings the traditional family card game into the Web3 era with multiplayer support, achievements, and on-chain profiles.

๐ŸŽฎ What is Whot?

Whot is a popular African card game similar to Crazy Eights, where players try to get rid of their cards by matching suits or numbers. The game features special cards with unique abilities and strategic gameplay that has been enjoyed by families across Africa for generations.

โœจ Key Features

๐Ÿƒ Classic Gameplay

  • Traditional Whot Rules: Authentic African card game experience
  • Special Cards: Hold On, Pick 2, General Market, and Whot cards with unique abilities
  • Strategic Play: Match suits, numbers, or use special cards to outmaneuver opponents
  • Multiple Players: Support for 2-4 players in both single-player and multiplayer modes

๐ŸŒ Multiplayer Experience

  • Real-time Gaming: Live multiplayer matches with real opponents
  • Room System: Create or join game rooms with customizable settings
  • Live Chat: Communicate with other players during games
  • Match History: Track your games and performance over time

โšก Blockchain Integration

  • Solana Network: Fast, low-cost transactions on Solana blockchain
  • Honeycomb Protocol: On-chain user profiles and achievements
  • Wallet Integration: Connect with Phantom, Solflare, and other Solana wallets
  • Achievement System: Earn achievements and track progress on-chain

๐Ÿ† Achievement System

  • Automatic Unlocking: Achievements unlock automatically when requirements are met
  • XP Rewards: Earn XP for completing games and unlocking achievements
  • On-chain Storage: All achievements and XP stored securely on Solana
  • Progress Tracking: Real-time progress monitoring for all achievements
  • Level System: Level up based on XP earned from games and achievements

๐ŸŽต Immersive Experience

  • Sound Effects: Authentic card sounds and game audio
  • Animations: Smooth card animations and visual effects
  • Responsive Design: Works perfectly on desktop and mobile devices
  • Modern UI: Beautiful, intuitive interface with retro gaming aesthetics

๐Ÿ”ง Technical Features

  • Firebase Integration: Real-time game state and user data
  • Web Audio API: Optimized sound system for mobile devices
  • SVG Rendering: High-quality card graphics with browser compatibility
  • Performance Optimized: Smooth gameplay even on low-end devices

๐Ÿš€ Getting Started

Prerequisites

  • A Solana wallet (Phantom, Solflare, etc.)
  • Some SOL for transaction fees (automatic airdrop provided for testing)
  • Modern web browser

How to Play

  1. Connect Wallet: Connect your Solana wallet to the game
  2. Create Profile: Set up your on-chain gaming profile
  3. Choose Mode: Select single-player or multiplayer
  4. Start Playing: Join a room or create your own
  5. Earn Achievements: Complete games to earn XP and unlock achievements

Game Rules

  • Match cards by suit or number
  • Use special cards strategically
  • Be the first to get rid of all your cards
  • Watch out for Whot cards - they can change the game!

๐Ÿ“ Project Structure

whotgo/
โ”œโ”€โ”€ src/                          # Main source code
โ”‚   โ”œโ”€โ”€ components/               # React components
โ”‚   โ”‚   โ”œโ”€โ”€ Game.jsx             # Main game interface and multiplayer logic
โ”‚   โ”‚   โ”œโ”€โ”€ Lobby.jsx            # Multiplayer room management and player matching
โ”‚   โ”‚   โ”œโ”€โ”€ popups/              # Modal dialogs and overlays
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AchievementPopup.jsx    # Achievement display and notifications
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GameLogPopup.jsx        # Game history and log viewer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GameModePopup.jsx       # Single-player vs multiplayer selection
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ HelpPopup.jsx           # Game rules and help documentation
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LeaderboardPopup.jsx    # Player rankings and statistics
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ProfilePopup.jsx        # User profile management and settings
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ RoundEndPopup.jsx       # Round completion and results screen
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SettingsPopup.jsx       # Game settings and preferences
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SyncPopup.jsx           # Data synchronization status
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ WhotShapePopup.jsx      # WHOT card shape selection interface
โ”‚   โ”‚   โ”œโ”€โ”€ BadgeNotification.jsx       # Achievement notification system
โ”‚   โ”‚   โ”œโ”€โ”€ ErrorBoundary.jsx           # Error handling and recovery
โ”‚   โ”‚   โ”œโ”€โ”€ LottieConfetti.jsx          # Celebration animations
โ”‚   โ”‚   โ”œโ”€โ”€ ProfileCreationStatus.jsx   # Profile creation progress UI
โ”‚   โ”‚   โ””โ”€โ”€ WalletProvider.jsx          # Solana wallet connection provider
โ”‚   โ”œโ”€โ”€ utils/                   # Utility functions and business logic
โ”‚   โ”‚   โ”œโ”€โ”€ profile.js           # Server-side Honeycomb Protocol integration and profile management
โ”‚   โ”‚   โ”œโ”€โ”€ profileClient.js     # Client-side profile operations
โ”‚   โ”‚   โ”œโ”€โ”€ achievementService.js # Achievement system, XP management, and game rewards
โ”‚   โ”‚   โ”œโ”€โ”€ soundEffects.js      # Audio system with Web Audio API
โ”‚   โ”‚   โ”œโ”€โ”€ cardSVG.js           # Card graphics and SVG rendering
โ”‚   โ”‚   โ”œโ”€โ”€ deck.js              # Card deck creation and shuffling
โ”‚   โ”‚   โ””โ”€โ”€ gameUtils.js         # Game logic utilities and helpers
โ”‚   โ”œโ”€โ”€ assets/                  # Static assets and resources
โ”‚   โ”‚   โ””โ”€โ”€ confetti-celebration.json   # Lottie animation data
โ”‚   โ”œโ”€โ”€ App.jsx                  # Main application component and state management
โ”‚   โ”œโ”€โ”€ App.css                  # Global styles and responsive design
โ”‚   โ”œโ”€โ”€ firebase.js              # Firebase configuration and initialization
โ”‚   โ”œโ”€โ”€ index.css                # Base CSS styles and resets
โ”‚   โ””โ”€โ”€ index.jsx                # Application entry point and React initialization
โ”œโ”€โ”€ public/                      # Public static assets
โ”‚   โ”œโ”€โ”€ assets/                  # Public assets directory
โ”‚   โ”‚   โ”œโ”€โ”€ sounds/              # Audio files and sound effects
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ effects/         # Individual sound effect files
โ”‚   โ”‚   โ””โ”€โ”€ Confetti Celebration.lottie  # Lottie animation file
โ”‚   โ”œโ”€โ”€ favicon.svg              # Website favicon
โ”‚   โ”œโ”€โ”€ manifest.json            # Progressive Web App manifest
โ”‚   โ””โ”€โ”€ output.css               # Compiled CSS output
โ”œโ”€โ”€ functions/                   # Firebase Cloud Functions
โ”‚   โ”œโ”€โ”€ index.js                 # Server-side logic and API endpoints
โ”‚   โ””โ”€โ”€ package.json             # Functions dependencies
โ”œโ”€โ”€ tools/                       # Development and build tools
โ”‚   โ”œโ”€โ”€ checkBraces.cjs          # Code validation and brace checking
โ”‚   โ”œโ”€โ”€ checkBraces.js           # Brace validation utility
โ”‚   โ””โ”€โ”€ convert-favicon.html     # Favicon conversion tool
โ”œโ”€โ”€ docs/                        # Documentation and guides
โ”œโ”€โ”€ .env files                   # Environment variables (not in repo)
โ”œโ”€โ”€ package.json                 # Project dependencies and scripts
โ”œโ”€โ”€ tailwind.config.js           # Tailwind CSS configuration
โ”œโ”€โ”€ vite.config.js               # Vite build tool configuration
โ”œโ”€โ”€ firebase.json                # Firebase project configuration
โ”œโ”€โ”€ netlify.toml                 # Netlify deployment configuration
โ”œโ”€โ”€ vercel.json                  # Vercel deployment configuration
โ””โ”€โ”€ README.md                    # This documentation file

๐Ÿ”ง Directory Structure Explained

src/ - Main Source Code

The heart of the application containing all React components, utilities, and business logic.

  • components/: Reusable UI components organized by functionality

    • Game.jsx: Core game interface handling card rendering, player interactions, and multiplayer synchronization
    • Lobby.jsx: Multiplayer room management, player matching, and game room creation
    • popups/: Modal dialogs for various game interactions and settings
    • Supporting Components: Error handling, notifications, and wallet integration
  • utils/: Business logic and utility functions

    • profile.js: Server-side Honeycomb Protocol integration and profile management
    • profileClient.js: Client-side profile operations and data fetching
    • achievementService.js: Achievement system, XP management, and game rewards
    • soundEffects.js: Complete audio system using Web Audio API for mobile compatibility
    • cardSVG.js: Card graphics generation and SVG rendering optimization
    • deck.js: Card deck creation, shuffling, and validation
    • gameUtils.js: Game logic helpers and utility functions
  • assets/: Static resources like animations and configuration files

public/ - Static Assets

Files served directly to the browser without processing.

  • assets/sounds/: Audio files for game sound effects and music
  • assets/: Other static resources like animations and images
  • Configuration Files: PWA manifest, favicon, and compiled CSS

functions/ - Backend Logic

Firebase Cloud Functions for server-side operations.

  • index.js: API endpoints for game state management and user data
  • package.json: Backend dependencies and configuration

tools/ - Development Utilities

Helper scripts and tools for development and build processes.

  • Code Validation: Brace checking and syntax validation tools
  • Asset Processing: Favicon conversion and other asset utilities

Configuration Files

  • package.json: Project dependencies, scripts, and metadata
  • tailwind.config.js: CSS framework configuration and customizations
  • vite.config.js: Build tool configuration and optimization settings
  • firebase.json: Firebase project settings and deployment configuration
  • netlify.toml: Netlify deployment settings and build commands
  • vercel.json: Vercel deployment configuration (alternative hosting)

๐Ÿ”ง Key Files Explained

Core Application Files

  • src/App.jsx: Main application component managing game state, wallet connection, and navigation
  • src/index.jsx: Application entry point with React initialization and provider setup
  • src/firebase.js: Firebase configuration and database connection setup

Game Logic Files

  • src/components/Game.jsx: Complete game interface with card rendering, animations, and multiplayer sync
  • src/utils/deck.js: Card deck management including creation, shuffling, and validation
  • src/utils/gameUtils.js: Game state utilities, player calculations, and helper functions

Blockchain Integration

  • src/utils/profile.js: Server-side Honeycomb Protocol integration and profile management
  • src/utils/profileClient.js: Client-side profile operations and data fetching
  • src/utils/achievementService.js: Achievement system with XP management and game rewards
  • src/components/WalletProvider.jsx: Solana wallet connection and adapter management

Audio and Graphics

  • src/utils/soundEffects.js: Complete audio system with Web Audio API for mobile optimization
  • src/utils/cardSVG.js: Card graphics generation with SVG optimization and caching
  • public/assets/sounds/: Audio files for game effects and background music

User Interface

  • src/components/popups/: Modal dialogs for game interactions, settings, and notifications
  • src/App.css: Global styles with responsive design and mobile optimizations
  • src/components/BadgeNotification.jsx: Achievement notification system

๐ŸŽฎ Game Architecture Overview

Data Flow

  1. User Authentication: Wallet connection โ†’ Profile creation/loading
  2. Game Initialization: Deck creation โ†’ Player setup โ†’ Game state initialization
  3. Gameplay Loop: Card actions โ†’ State updates โ†’ Firebase sync โ†’ UI updates
  4. Multiplayer Sync: Real-time updates via Firebase โ†’ Player coordination
  5. Achievement Tracking: Progress monitoring โ†’ Achievement unlocking โ†’ Blockchain updates

State Management

  • Local State: React hooks for UI state and component data
  • Firebase: Real-time game state, user profiles, and multiplayer data
  • Honeycomb Protocol: On-chain achievements, XP, and user profiles
  • LocalStorage: User preferences, session data, and cached information

Component Hierarchy

App.jsx (Main Container)
โ”œโ”€โ”€ WalletProvider (Wallet Connection)
โ”œโ”€โ”€ Game (Game Interface)
โ”‚   โ”œโ”€โ”€ Player Cards (User's hand)
โ”‚   โ”œโ”€โ”€ Opponent Cards (AI/Other players)
โ”‚   โ”œโ”€โ”€ Play Pile (Current card)
โ”‚   โ”œโ”€โ”€ Market Deck (Draw pile)
โ”‚   โ””โ”€โ”€ Game Controls (Actions)
โ”œโ”€โ”€ Popups (Modal Dialogs)
โ”‚   โ”œโ”€โ”€ AchievementPopup
โ”‚   โ”œโ”€โ”€ SettingsPopup
โ”‚   โ”œโ”€โ”€ HelpPopup
โ”‚   โ””โ”€โ”€ Other Modals
โ””โ”€โ”€ Navigation (Menu System)

This structure provides a clear separation of concerns, making the codebase maintainable, scalable, and easy to understand for new developers joining the project.

๐Ÿ› ๏ธ Technology Stack

  • Frontend: React.js with Vite
  • Blockchain: Solana with Honeycomb Protocol
  • Backend: Firebase (Realtime Database, Cloud Functions)
  • Styling: Tailwind CSS
  • Audio: Web Audio API
  • Graphics: SVG with browser optimization
  • Deployment: Netlify

๐ŸŒ Live Demo

Play Now: https://whotgo.netlify.app

๐Ÿค Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.

๐Ÿ“„ License

This project is licensed under the MIT License.


Join the Whot Go! community and experience the future of African card gaming on the blockchain! ๐Ÿƒโœจ

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages