hackquest logo

OopSs

A browser-based, OopSss.io-inspired multiplayer snake game integrated with blockchain for SocialFi (decentralized social features) and GameFi (play-to-earn) mechanics on U2U Solaris Mainnet.

视频

描述

OopSss - SocialFi GameFi Snake Game

A browser-based, OopSss.io-inspired multiplayer snake game integrated with blockchain for SocialFi (decentralized social features) and GameFi (play-to-earn) mechanics on U2U Solaris Mainnet.

🔗 Live Links & Contract

🌐 Live Application

📄 Smart Contract

  • Contract Address: 0x5B60CF7edCCc82350C223eF591a4C951d64e74EF

  • Token Symbol: $ST (OopSss Token)

  • Network: U2U Solaris Mainnet

  • Explorer: View on U2U Explorer

  • ABI: Available in src/contracts/SnakeToken.json

🎮 Features

Gameplay Mechanics

  • Snake Control: Mouse steering (PC) or arrow keys (keyboard)

  • AI Opponents: 6 computer-controlled snakes to compete against

  • Objective: Collect food to grow and avoid AI snakes

  • Rewards: Earn 1 $ST per food item collected

  • Entry Fee: Pay 1 $ST per match

  • Game Over: Touching AI snake ends game immediately

Blockchain Integration ($ST Token)

  • Custom ERC-20 Token: $ST (OopSss Token) on U2U Solaris Mainnet

  • Entry Fees: 1 $ST per match

  • Food Rewards: 1 $ST per food item collected

  • Daily Login: 2 $ST base reward + streak bonuses

  • Leaderboard Rewards: Bonus $ST for top performers

SocialFi Elements

  • Wallet-based Profiles: Customizable snake skins

  • Daily Login Rewards: Encouraging retention with streak bonuses

  • Leaderboards: Daily/weekly rankings with bonus rewards

  • Community Challenges: Collective goals for bonus $ST pools

🚀 Getting Started

Prerequisites

  • Node.js 18+ or Bun

  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd oopsss
  2. Install dependencies

    bun install
    # or
    npm install
  3. Set up environment variables Create a .env.local file:

    NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your-walletconnect-project-id
  4. Run the development server

    bun run dev
    # or
    npm run dev
  5. Open your browser Navigate to http://localhost:3000

🎯 How to Play

Controls

  • PC:

    • Mouse: Steer snake (follows cursor)

    • Arrow Keys: Speed boost (costs $ST)

    • Space: Temporary speed boost

  • Mobile:

    • Finger swipes: Direction control

    • Tap: Speed boost

Game Flow

  1. Connect Wallet: Connect your U2U Solaris Mainnet wallet

  2. Claim Daily Reward: Get 2 $ST daily login bonus

  3. Enter Match: Pay 1 $ST entry fee

  4. Play: Survive as long as possible

  5. Earn: Receive $ST based on survival time

  6. Compete: Climb the leaderboards

🏗️ Technical Architecture

Frontend

  • Framework: Next.js 14 with TypeScript

  • Game Engine: Phaser.js 3.90.0

  • Styling: Tailwind CSS

  • Wallet Integration: RainbowKit + Wagmi

  • State Management: React hooks

Blockchain

  • Network: U2U Solaris Mainnet

  • Token Standard: ERC-20

  • Smart Contracts:

    • OopSssToken.sol: Token management and rewards

    • OopSssGame.sol: Game logic and leaderboards

  • Integration: Web3.js + Viem

Smart Contracts

OopSssToken.sol

  • ERC-20 token with game-specific features

  • Daily login rewards with streak bonuses

  • Entry fee management

  • Survival reward distribution

OopSssGame.sol

  • Game session management

  • Leaderboard tracking

  • Player statistics

  • Reward calculations

🎨 Game Assets

The game uses simple colored rectangles for MVP:

  • Player Snake: Green rectangle

  • Bot Snakes: Red rectangles

  • Orbs: Yellow rectangles

  • Background: Black canvas

Note: In production, these would be replaced with proper game sprites and animations.

技术栈

React
Next
Web3
队长
AAlex
赛道
SocialFiGamingDeFi