Deepseek ArtifactsDeepseek Artifacts

Match & Win 游戏指南

4.0
en
游戏开发
卡牌游戏
Bubble.io
支付集成

Prompt

App Concept: "Match & Win" Card Game**

**Core Idea:**  
A web-based memory-matching game where users flip cards to find triple matches and earn redeemable points. Players pay $0.5 per game round (or use daily free plays) with a 30% house edge.

---

### **Key Features**

1. **Game Mechanics**  
   - 12 cards with 4 sets of 3 identical symbols (e.g., 🍎🍌🍊🍇).  
   - Users flip 3 cards/attempt.  
   - Match 3 identical symbols → Win points (70% of entry fees).  

2. **Points System**  
   - 100 points = $1 redeemable.  
   - Minimum withdrawal: $5 (500 points).  

3. **Monetization**  
   - Entry fee: $0.5 per play (converted to points).  
   - Daily free play via rewarded ads/tasks.  

4. **Payment Integration**  
   - Deposit: ZainCash, AsiaCell, Visa/Mastercard.  
   - Withdrawal: Manual approval via admin panel.  

---

### **Bubble.io Implementation Guide**

#### A. **Data Types**  
1. **User**  
   - Email (unique)  
   - Password  
   - Points (number)  
   - LastFreePlay (date)  

2. **Card**  
   - Symbol (text)  
   - IsFlipped (yes/no)  
   - Position (number 1-12)  
   - User (User)  

3. **Reward**  
   - Symbol (text)  
   - Points (number)  

---

#### B. **Workflows**  
1. **Game Initialization**  
   - On app load → Generate 12 random cards with 3x duplicates.  

2. **Card Flipping**  
   - When user clicks card →  
     a. Reveal symbol (update `IsFlipped=yes`)  
     b. Count flipped cards  
     c. After 3 flips → Check match  

3. **Win/Lose Logic**  
   - If 3 symbols match →  
     a. Add points: `User:points + Reward:points`  
     b. Reset cards  

4. **Daily Free Play**  
   - CRON job → Reset `LastFreePlay` daily.  

---

#### C. **UI Elements**  
1. **Main Game Screen**  
   - 12-card grid (3x4 layout)  
   - Points counter (dynamic text)  
   - "Play Now" button ($0.5)  
   - "Free Play" button (conditional visibility)  

2. **Admin Panel**  
   - Manual withdrawal approval  
   - Edit reward point values  

---

### **Payment Setup Tips**  
1. Use **Stripe/PayPal Plugin** for card payments.  
2. For ZainCash/AsiaCell → Use manual approval flow:  
   - User submits withdrawal request →  
   - Admin confirms via mobile money →  
   - Deduct points.  

---

### **Recommended Plugins**  
1. **Toolbox** (for animations)  
2. **Stripe API** (card payments)  
3. **Scheduler** (daily free play reset)  

---

### **Legal Note**  
Add disclaimer: *"This game requires skill in memory and pattern recognition"* to avoid gambling classification.

Generated Result

import React, { useState, useEffect } from 'react';
import './App.css';

const App = () => {
  const [cards, setCards] = useState([]);
  const [flippedCards, setFlippedCards] = useState([]);
  const [points, setPoints] = useState(0);
  const [hasFreePlay, setHasFreePlay] = useState(true);

  const symbols = ['🍎', '🍌', '🍊', '🍇'];

  useEffect(() => {
    initializeGame();
  }, []);

  const initializeGame = () => {
    const cardSet = symbols.flatMap(symbol => Array(3).fill(symbol));
    const shuffledCards = cardSet.sort(() => Math.random() - 0.5);
    setCards(shuffledCards.map((symbol, index) => ({ id: index, symbol, isFlipped: false })));
    setFlippedCards([]);
  };

  const handleCardClick = (id) => {
    if (flippedCards.length >= 3) return;
    const updatedCards = cards.map(card =>
      card.id === id ? { ...card, isFlipped: true } : card
    );
    setCards(updatedCards);
    const newFlippedCards = [...flippedCards, id];
    setFlippedCards(newFlippedCards);
    if (newFlippedCards.length === 3) {
      checkMatch(newFlippedCards);
    }
  };

  const checkMatch = (flippedCardIds) => {
    const flippedSymbols = flippedCardIds.map(id => cards.find(card => card.id === id).symbol);
    if (new Set(flippedSymbols).size === 1) {
      setPoints(points + 70);
    }
    setTimeout(() => {
      initializeGame();
    }, 1000);
  };

  const handlePlayNow = () => {
    initializeGame();
  };

  const handleFreePlay = () => {
    setHasFreePlay(false);
    initializeGame();
  };

  return (
    <div className="flex flex-col items-center justify-center min-h-screen bg-gradient-to-br from-purple-400 to-indigo-600 text-white">
      <h1 className="text-4xl font-bold mb-8">Match & Win</h1>
      <div className="grid grid-cols-3 gap-4 mb-8">
        {cards.map(card => (
          <div
            key={card.id}
            className="w-24 h-24 flex items-center justify-center bg-white text-4xl rounded-lg shadow-lg cursor-pointer transition-transform transform hover:scale-105"
            onClick={() => handleCardClick(card.id)}
          >
            {card.isFlipped ? card.symbol : '?'}
          </div>
        ))}
      </div>
      <div className="text-2xl mb-8">Points: {points}</div>
      <div className="flex space-x-4">
        <button
          className="px-6 py-2 bg-green-500 text-white rounded-lg shadow-md hover:bg-green-600 transition-colors"
          onClick={handlePlayNow}
        >
          Play Now ($0.5)
        </button>
        {hasFreePlay && (
          <button
            className="px-6 py-2 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600 transition-colors"
            onClick={handleFreePlay}
          >
            Free Play
          </button>
        )}
      </div>
      <footer className="mt-8 text-sm text-gray-200">
        © 2025 Match & Win. This game requires skill in memory and pattern recognition.
      </footer>
    </div>
  );
};

export default App;

More Recommendations

View All

Build ChatGPT-Like Web Interface

4.0
Software Development
en
AI Integration
Full-Stack Development
ChatGPT
UI Design
Backend Orchestration
You are a professional full-stack developer AI with deep experience in building AI-integrated UIs, backend orchestration, and vector memory systems. I want you to build a **web-based ChatGPT-like int...

Flutter 产品列表页

4.0
编程开发
en
Flutter
Dart
产品列表
class ProductListPage extends StatefulWidget { final bool useArabic; const ProductListPage({super.key, this.useArabic = false}); @override State<ProductListPage> createState() => _ProductLis...

Flutter产品列表页

4.0
编程开发
en
Flutter
产品列表
Widget
class ProductListPage extends StatefulWidget { final bool useArabic; const ProductListPage({super.key, this.useArabic = false}); @override State<ProductListPage> createState() => _ProductLis...

Build XO App with AI

4.0
Programming
en
Tic Tac Toe
AI Game
JavaScript
create a complete XO (Tic Tac Toe) app with AI opponent: "Build a modern, fully-featured Tic Tac Toe (XO) app that includes: A clean, user-friendly interface optimized for mobile, tablet, and web. ...

Generate YouTube Subscribers

4.0
Technology
en
YouTube
Subscribers
App
Make an app let generate YouTube subscribers and and comments by enter your username after that the says how many subscribers and like do you want so you type the amount of likes and subscribers , so ...

YouTube Subscribers App

4.0
Technology
en
YouTube
Subscribers
App
Make an app let generate YouTube subscribers and and comments by enter your username after that the says how many subscribers and like do you want so you type the amount of likes and subscribers , so ...