A blockchain-powered Candy Crush-style game built with React and Linera Protocol.
- 🎮 Classic Match-3 Gameplay: Drag and drop to create matches
- ⛓️ Blockchain Integration: Scores are converted to test-tokens on Linera Microchains
- 🏆 Real-time Leaderboard: Compete with other players
- 👤 User Authentication: Simple login system with persistent sessions
- 📱 Responsive Design: Works on desktop and mobile devices
- 📱 Mobile Touch Support: Full touch/swipe controls for mobile gameplay
- 💾 Offline Mode: Play even when blockchain is unavailable
- 🔧 Admin Panel: Administrative controls for game management
This game integrates with the Linera protocol to:
- Convert game scores to testnet tokens
- Provide verifiable game sessions
- Match 3 or more chains in a row or column
- Score points for each match (3 chains = 3 points, 4 chains = 4 points)
- 60-second time limit
- Scores are converted to test-tokens when connected
The game now includes full mobile touch support:
- Touch Controls: Tap and swipe to move pieces
- Swipe Gestures: Swipe in any direction to move adjacent pieces
- Touch Feedback: Visual feedback for touch interactions
- Mobile Optimized: Prevents scrolling and zooming during gameplay
- Responsive Design: Adapts to different screen sizes
- Start the Game: Tap the "Start Game" button
- Move Pieces: Tap and swipe on a candy piece in the direction you want to move it
- Valid Moves: Only adjacent pieces can be swapped
- Match Detection: The game automatically detects and removes matches
- Score Tracking: Your score is displayed and tracked in real-time
The mobile version maintains all the same features as the desktop version, including blockchain integration and leaderboard functionality.
- User Authentication System
- Login with username
- Discord OAuth integration
- User preferences and settings
- Secure password hashing
- Session management with 24-hour timeout
- Persistent login state
- Smooth Animations
- Falling animations
- Match explosion effects
- Score popup animations
- Smooth transitions between game states
- Particle effects for special matches
- Advanced Leaderboard System
- Separate smart contract for leaderboard management
- Multiple leaderboard categories (daily, weekly, all-time)
- Player ranking system with tiers
- Historical performance tracking
- Seasonal competitions with rewards
- Tournament system with admin controls
- Tournament timers and countdowns
- Tournament leaderboards (top 25 results)
- Tournament status management with grace periods
- Special Chains & Power-ups
- Lightning chains (clear entire row/column)
- Bomb chains (clear surrounding area)
- Rainbow chains (match any color)
- Multiplier chains (2x, 3x score bonuses)
- Time freeze power-ups
- Chain shuffle abilities
- Multiple Game Modes
- Free Mode: Unlimited time, practice mode
- Fast Mode: 30-second quick games
- Endurance Mode: Progressively harder levels
- Puzzle Mode: Specific objectives to complete
- Daily Challenge: Special objectives with bonus rewards
- Multiplayer Modes
- Turn-based Mode: Players take turns, highest score wins
- Parallel Playing: Real-time simultaneous gameplay
- Tournament Mode: Bracket-style competitions
- On-chain Achievements
- Smart contract for achievement tracking
- NFT badges for major milestones
- Achievement categories:
- Score-based achievements (reach X points)
- Combo achievements (X matches in a row)
- Speed achievements (complete game in X seconds)
- Consistency achievements (play X days in a row)
- Special move achievements (use power-ups X times)
- Social achievements (invite friends, win tournaments)
- Performance & Scalability
- Game state optimization
- Blockchain transaction batching
- Offline game state synchronization
- Progressive Web App (PWA) features
- Sound Design
- Match sound effects
- Background music (Jay Someday - Strawberry.mp3)
- Power-up activation sounds
- Victory/defeat audio feedback
- Music controls with mute button
- Audio autoplay handling for browser compatibility
- Player Analytics
- Game performance metrics
- Player behavior tracking
- Blockchain transaction analytics
- Leaderboard statistics dashboard
- Node.js (v14 or higher)
- npm or yarn
- Linera CLI (for blockchain features)
- Clone the repository:
git clone https://github.com/liolikus/chain-crush.git
cd chain-crush- Install dependencies:
npm install- Start the development server:
npm start- Open http://localhost:3000 to view it in the browser.
Create a .env file in the root directory:
REACT_APP_LINERA_FAUCET=https://faucet.testnet-babbage.linera.net
REACT_APP_APPLICATION_ID=your_application_id_here- Frontend: React 17, JavaScript ES6+
- Blockchain: Linera Protocol
- Smart Contract: Rust (Fungible Token)
- Styling: CSS3 with animations
- Build Tool: Create React App
chain-crush/
├── src/
│ ├── components/ # React components
│ │ ├── GameBoard.js # Game board component
│ │ ├── GameControls.js # Game control buttons
│ │ ├── LoginModal.js # User authentication
│ │ ├── UserBar.js # User information display
│ │ ├── Leaderboard.js # Score leaderboard
│ │ ├── BlockchainInfo.js # Blockchain status
│ │ └── LoadingScreen.js # Loading screen
│ ├── hooks/ # Custom React hooks
│ │ ├── useLinera.js # Blockchain integration
│ │ ├── useAuth.js # Authentication logic
│ │ ├── useGameLogic.js # Game mechanics
│ │ └── useGameTimer.js # Timer functionality
│ ├── utils/ # Utility functions
│ │ ├── authUtils.js # Authentication helpers
│ │ ├── adminUtils.js # Admin functionality
│ │ └── leaderboardUtils.js # Leaderboard management
│ ├── services/ # External services
│ │ └── lineraService.js # Linera blockchain service
│ ├── constants/ # Game configuration
│ │ └── gameConstants.js # Game settings and constants
│ ├── images/ # Game assets
│ └── App.js # Main application
├── contract/ # Linera smart contract (Rust)
│ ├── src/ # Contract source code
│ └── Cargo.toml # Rust dependencies
└── public/ # Static assets
- Original Candy Crush concept
- Linera Protocol team
- @kubowania
🎮 Start playing Chain Crush and earn test-tokens while having fun! 🎉
Built with ❤️ using React and Linera Protocol