尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
A lightweight, zero-dependency reimagining of a classic. Built with pure JavaScript for instant browser play. Enjoy seamless solo modes and real-time multiplayer without ever hitting download.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Stack blocks. Send garbage. Crush your friends.
The classic puzzle game reimagined for the modern web. Play solo, compete in daily challenges, battle friends in real-time multiplayer, or organize tournaments — all in your browser, no downloads required. Pure JavaScript, modular architecture, instant fun.
Created by Carlos S. Nah
Five Game Modes
Tournament System 🆕
Play Custom Seeds - Enter a shared seed code to challenge friends
NES-Style Scoring
Retro Sound Effects - 8-bit style sounds generated with Web Audio API
Fully Mobile Responsive - Optimized touch controls and layout for all screen sizes
PWA Support - Install as an app, works offline, auto-updates when online
Leaderboards - Global, daily, and weekly leaderboards with persistent storage
| Key | Action |
|---|---|
| ← → | Move left/right |
| ↑ | Rotate |
| ↓ | Soft drop |
| Space | Hard drop |
| P | Pause (not in Hardcore) |
| H | Help |
Touch control buttons appear below the game canvas on mobile devices.
In Daily mode, everyone gets the same piece sequence based on the date.
Seed format: FLX-YYYY-MM-DD
Share your score with friends:
Flixtris Daily Challenge
FLX-2026-1-3
Score: 12430 | Level: 8 | Lines: 72
Can you beat my score?
Friends can enter the seed via "Play Seed" to get the exact same game.
Challenge friends to real-time 1v1 battles!
How it works:
Multiplayer Features:
🎯 Garbage Lines - Clear multiple lines to send garbage to your opponent!
😀 Quick Emojis - Send reactions during the game (👍 🔥 😀 💀 and more)
🔄 Rematch - Quick rematch button to play again with the same opponent
🔌 Reconnection - Disconnect? No problem! Auto-reconnect keeps your game alive
💾 Server Persistence - Server saves state, survives restarts
Serve with any static server:
npx serve .
# or
python -m http.server 8000
Open in browser and optionally install as a PWA.
The premium roadmap is being implemented incrementally. Current status:
purchases store)The store is designed to be local-first and data-attribute driven:
data-store-theme="light|neon|retro" will purchase/apply themes.data-store-skin="outline|pixel" will purchase skins.data-store-emoji="fire|grin|skull" purchase emojis.data-emoji="🔥" and optionally data-emoji-id="fire" so entitlement checks map correctly.Testing tips:
window.Flixtris.api.db.saveSetting("balance", 500)What’s recorded:
Viewer usage:
Basic tests are provided to validate analytics and replay playback:
npm run test (executes analytics and replay tests sequentially)npm run test:analyticsnpm run test:replayNotes:
The multiplayer feature requires running the WebSocket server with Redis:
Prerequisites:
# Start Redis (if running locally)
redis-server
# Navigate to server directory
cd server
# Install dependencies
npm install
# Start the server
npm start
Environment Variables:
| Variable | Default | Description |
|---|---|---|
PORT | 3001 | WebSocket server port |
REDIS_URL | redis://localhost:6379 | Redis connection URL |
# Example with custom configuration
PORT=8080 REDIS_URL=redis://user:pass@host:6379 npm start
Health Check:
curl http://localhost:3001/health
# Returns: {"status":"ok","redis":"connected","rooms":0,"uptime":123.45}
Server Features:
Production Deployment:
# Using Docker with Redis
docker run -d --name redis redis:alpine
docker run -d --name flixtris-server \
-e REDIS_URL=redis://redis:6379 \
-e PORT=3001 \
-p 3001:3001 \
--link redis \
node:18-alpine sh -c "cd /app && npm start"
wss://Create and manage competitive tournaments:
Tournament Types:
Flixtris includes an intelligent update system for PWA users:
The update system ensures you always have the latest features and bug fixes without manual intervention.
flixtris/
├── index.html # Main HTML
├── manifest.json # PWA manifest
├── version.json # Version info for update system
├── sw.js # Service Worker for PWA and caching
├── css/
│ └── styles.css # All application styles
├── js/
│ ├── db.js # IndexedDB storage and data management
│ ├── sound.js # Web Audio sound effects
│ ├── screens.js # Screen navigation and state 🆕
│ ├── settings.js # Settings management 🆕
│ ├── leaderboard.js # Leaderboard display and management 🆕
│ ├── tournament.js # Tournament system 🆕
│ ├── updates.js # Auto-update system 🆕
│ ├── game.js # Core game logic and rendering
│ ├── bot.js # AI bot implementation
│ ├── multiplayer.js # WebSocket multiplayer client
│ └── ui.js # UI coordination and event handling
├── server/
│ ├── index.js # WebSocket multiplayer server (Redis-backed)
│ ├── package.json # Server dependencies (ws, redis)
│ └── .gitignore # Ignore node_modules and env files
└── icons/
├── icon.svg
├── icon-192.png
└── icon-512.png
Philosophy: No frameworks. No build tools. Minimal dependencies. Maximum performance and maintainability through clean, modular code.
The multiplayer system uses a simple JSON message protocol:
Room Management:
create_room / room_createdjoin_room / room_joinedready / player_readyleave_room / player_leftGame Updates:
game_update / opponent_updategame_over / player_game_overBattle Features:
send_garbage / incoming_garbagesend_emoji / emoji_receivedrequest_rematch / rematch_startingConnection:
reconnect / reconnectedserver_shutdownThe server uses the following Redis keys:
| Key Pattern | Type | Description |
|---|---|---|
flixtris:room:{code} | String (JSON) | Room metadata (code, seed, started, createdAt) |
flixtris:room:{code}:players | String (JSON) | Player data array |
flixtris:reconnect:{token} | String (JSON) | Reconnection token data |
flixtris:rooms:active | Set | Set of active room codes |
All keys have a 30-minute TTL for automatic cleanup.
MIT