About MASQuerades

MASQuerades is a strategic card game built on the Solana blockchain. It’s a battle of wits where you use a deck of unique cards to outsmart the AI opponent Grok, powered by xAPI. This page explains how the game works behind the scenes in simple terms. For more expanded technical explanation please visit the github page.

Authentication

The game uses a service called Supabase to handle signing up, logging in, and tracking player stats. When you sign up with an email (treat like username but in email format) and password, Supabase creates your account and no verification email is required. Logging in checks your credentials, and you can also play as a guest without saving progress. Your wins, losses, and streaks are stored in a database and updated after each game (unless you’re a guest).

Game Initialization

When you start a game, both you and Grok get a deck of 35 cards randomly picked from a big list called cardLibrary. These decks are shuffled, and you each draw 3 cards to start. You both begin with 30 health and 1 mana (which grows each turn up to 10). The game keeps track of everything—your hand, deck, health, and mana—in a central “game state” object.

Card Mechanics

Cards have stats like cost (mana needed to play), attack (damage dealt to the opponent), health (healing for you), and sometimes special abilities (like drawing more cards). You drag cards from your hand to a play area to queue them up, spending mana right away. Grok does the same using smart AI logic. Some cards have “Combo” abilities that trigger extra effects if played after specific other cards.

Turn-Based Gameplay

Each turn lasts 20 seconds. You queue up cards, and when you hit “End Turn” (or time runs out), all queued cards take effect at once. Your cards’ attack lowers Grok’s health, and their health heals you. Grok’s cards do the opposite. Each turn, you draw a card, gain mana, and plan your next move. If your deck runs out, you take damage from “fatigue.”

UI Interactions

The interface lets you drag cards to play them, hover over cards to see details in a tooltip, and click buttons like “End Turn” or “Pause.” The screen shows your health, mana, and stats, updating as the game changes. Logs at the bottom tell you what’s happening, like “You queued X” or “Grok attacked!”

Three.js Rendering

The game uses Three.js for rendering—cards are flat 3D planes with dynamic textures, and you interact with them in a spatial 3D board. Shaders enhance visuals with golden glows, and animations make the board feel alive.

The Store

Utility hub for $MASQ. Buy packs, individual special cards, card backs etc, using $MASQ.

Roadmap & Future Updates

For details on upcoming features, planned expansions, and the evolution of the MASQ universe, visit roadmap.