Gin Rummy Online - Free Card Matching Game

Seele01-Flash
By
Gin Rummy Online is a free browser-based card matching game where you form combinations of three or more cards. Play against AI opponents of varying difficulties to master this classic card game that's been enjoyed since 1909.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Gin Rummy Online**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: Create a polished, semi-realistic 3D card table environment. Use the distinctive **Magenta/Pink felt texture** for the table surface (as seen in the reference) but apply a vignette effect to focus attention on the center. * **Card Models**: Use thin `BoxGeometry` for cards (not just flat planes) to give them depth when flipping. Textures must include standard 52-card faces and a red/classic pattern for the card backs. * **Layout**: * **Player Hand**: Arranged in a curved "fan" arc at the bottom center. * **Opponent Hand**: Stacked or fanned face-down at the top center. * **Center Area**: A `Draw Pile` (face down) and a `Discard Pile` (face up) located in the middle. * **Score Bubbles**: Floating 3D text or UI sprites above the piles showing the current deadwood count or score when relevant. * **Optimization**: Use a single texture atlas for all card faces to reduce draw calls. Implement object pooling for card meshes to avoid garbage collection stutters on mobile devices. ### 2. Audio Requirements * **BGM**: A smooth, relaxing **Lounge Jazz** or **Bossa Nova** loop. It should be low-intrusiveness to aid concentration. * **Sound Effects (SFX)**: * *Card Shuffle*: A crisp riffling sound at the start. * *Card Flip/Snap*: High-frequency "snap" sound when a card is played. * *Card Slide*: Soft friction sound when dragging cards across the felt. * *Button Feedback*: A subtle click for UI interactions. * *Victory/Loss*: A cheerful chime for "Gin" and a dull thud or low tone for losing. ### 3. Gameplay Loop * **Setup**: Deal 10 cards to the Player and the CPU. Place the remaining deck face down (Stock) and turn one card face up (Discard Pile). * **Turn Structure**: 1. **Draw Phase**: Player must tap either the Stock pile or Discard pile to add a card to their hand (total 11 cards). 2. **Meld Logic**: The code must automatically detect or allow players to organize cards into **Sets** (3-4 cards of same rank) or **Runs** (3+ cards of same suit in sequence). 3. **Discard Phase**: Player selects one card to remove to end their turn. * **Win Conditions**: * **Gin**: Player has 0 "deadwood" (unmatched cards). * **Knock**: Player ends the round with 10 or fewer points of deadwood. * **Undercut**: If the opponent has equal or lower deadwood than the knocker, the opponent wins points. * **Difficulty**: Implement a simple AI that prioritizes completing runs/sets and discarding high-value unmatched cards. ### 4. Mobile Controls & Interaction * **Orientation**: **Landscape Mode** is mandatory to accommodate the 10-card hand spread comfortably on mobile screens. * **Touch Interactions**: * **Tap-to-Select**: Tapping a card lifts it slightly (visual feedback). * **Tap-to-Target**: Tapping the discard pile sends the selected card there. * **Drag-and-Drop**: Allow dragging cards within the hand to reorder them manually. * **UI/UX**: * Action buttons ("Knock", "Sort Hand") must be large (>44px height) and placed on the right side of the screen for thumb reachability. * Highlight valid moves: When a card is selected, highlight the discard pile to indicate it's a valid destination. * **Haptic Feedback**: Trigger a short, light vibration (using `navigator.vibrate`) when a card is successfully discarded or when a valid Meld is formed. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Gin Rummy Online is the digital version of the beloved classic card game that has entertained players for over a century. This free browser-based card matching game challenges you to form strategic combinations while outsmarting your opponents. Whether you're a beginner learning the ropes or an experienced player looking to sharpen your skills, this online version offers multiple difficulty levels to keep you engaged.

The game features a clean, intuitive interface with vibrant card designs that make gameplay both visually appealing and easy to follow. You can jump right into a match without any downloads or installations required.

Core Features

Free and Accessible Gaming

  • Completely free to play with no hidden costs or premium features
  • No download required - play instantly in any modern web browser
  • Cross-platform compatibility supporting both desktop and mobile devices
  • Multiple difficulty levels from beginner-friendly to expert challenges

Strategic Card Gameplay

  • Classic Gin Rummy rules faithfully recreated for authentic gameplay
  • AI opponents with varying skill levels to match your experience
  • Real-time card matching with smooth animations and responsive controls
  • Score tracking to monitor your progress and improvement

User-Friendly Design

  • Intuitive mouse controls - simply point and click to play
  • Clear card visibility with large, easy-to-read card faces
  • Visual feedback for valid moves and combinations
  • Responsive layout that adapts perfectly to different screen sizes

Game Mechanics

Building Winning Combinations

The core objective is to form melds - groups of three or more cards that follow specific patterns: - Sets : Three or four cards of the same rank (e.g., three Kings) - Runs : Three or more consecutive cards of the same suit (e.g., 6-7-8 of Hearts)

Turn-Based Strategy

Each turn involves careful decision-making: 1. Draw a card from either the face-down deck or the discard pile 2. Analyze your hand to identify potential combinations 3. Discard strategically to improve your chances while avoiding giving opponents advantages

Winning Conditions

  • Knocking : End the round when you have minimal unmatched cards
  • Going Gin : Achieve the ultimate victory by matching all cards in your hand
  • Strategic timing : Know when to end the game for maximum points

Operation Guide

Getting Started

  1. Launch the game by clicking play - no account creation needed
  2. Select difficulty level based on your experience
  3. Familiarize yourself with the card layout and interface

Basic Controls

  • Left mouse button : Select, drag, and drop cards
  • Click and drag : Move cards between your hand and play areas
  • Single click : Pick up cards from draw or discard piles
  • Right-click menus : Access additional game options (where available)

Gameplay Tips

  • Observe opponent discards to guess their strategy
  • Keep flexible combinations that can form multiple melds
  • Count cards carefully to track what's still available
  • Practice timing your knocks for optimal scoring

Why Play This Game

Mental Stimulation and Strategy

Gin Rummy Online offers the perfect blend of luck and skill, making each game a unique mental challenge. The strategic depth keeps experienced players engaged while remaining accessible to newcomers.

Convenient Entertainment

With no downloads required and full mobile support, you can enjoy a quick game during breaks or settle in for longer sessions at home. The game saves your progress automatically, so you never lose your momentum.

Skill Development

Regular play helps develop: - Pattern recognition through card combination identification - Strategic thinking via opponent analysis and timing decisions - Memory skills by tracking played and discarded cards - Risk assessment when deciding to knock or continue playing

Social and Competitive Elements

While playing against AI, you're preparing for real-world card games with friends and family. The multiple difficulty levels ensure you're always challenged appropriately as your skills improve.

Whether you're looking to learn this timeless card game or want to enjoy it without the hassle of physical cards, Gin Rummy Online delivers an authentic, engaging experience that's always just a click away.

Frequently Asked Questions (FAQ)