Block the Pig

Seele01-Flash
By
Block the Pig is an engaging puzzle game that challenges your strategic thinking. Place blocks strategically to trap a clever pig before it escapes, with each round becoming progressively more difficult.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Block the Pig**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: Cute, vibrant, cartoonish 3D low-poly aesthetic. The colors should be bright and saturated (e.g., sky blue background, bright green grass tiles, pink pig). * **The Pig (Protagonist)**: A cute, spherical or slightly chubby low-poly pink pig. It should have basic idle animations (bouncing gently, looking around) and a movement animation (hopping between tiles). * **The Board (Hexagonal Grid)**: * Create a **hexagonal grid** floating in the center of the screen (e.g., an 11x11 grid, though only a subset might be active). * **Empty Tiles**: Light green hexagons representing grass. * **Blocked Tiles**: Darker stone or wooden pillar obstacles that rise up when clicked. * **Background**: A soft gradient sky blue with fluffy, low-poly white clouds floating slowly in the distance to add depth without distracting. * **Optimization**: Use `THREE.InstancedMesh` for the hexagonal tiles to ensure high performance on mobile devices (60fps target). Use simple Lambert or Toon materials to keep rendering costs low. ### 2. Audio Requirements * **BGM**: A whimsical, lighthearted, and looping track using marimba, pizzicato strings, and a light flute melody. It should feel "thinking-time" appropriate but cheerful. * **SFX**: * **Placing Block**: A satisfying "thud" or "pop" sound (stone hitting earth). * **Pig Move**: A cute, high-pitched "oink" or a squishy hop sound. * **Pig Trapped (Win)**: A cheerful fanfare with a happy squeal. * **Pig Escape (Lose)**: A comical "sad trombone" or slipping sound effect. * **UI Click**: Soft, wooden clicks. ### 3. Gameplay Loop * **Setup**: The pig starts in the center of the hexagonal grid. Several random tiles are already blocked at the start of the round to make the puzzle solvable. * **Turn-Based Logic**: 1. **Player Turn**: The player taps an empty tile to turn it into a blocked tile (obstacle). 2. **Pig Turn**: The pig calculates the shortest path to the edge of the grid (using Breadth-First Search or A* algorithm suited for hex grids). It moves one tile towards the nearest edge. * **Win Condition**: The pig is completely surrounded by obstacles and has no path to the edge. * **Lose Condition**: The pig reaches any tile on the outermost edge of the grid. * **Progression**: Upon winning, reset the board but generate fewer pre-blocked tiles or place them in trickier configurations to increase difficulty. ### 4. Mobile Controls & Interaction * **Input Handling**: * Implement `Raycaster` for precise touch detection on the hexagonal tiles. * **One-Tap Gameplay**: The primary interaction is a single tap to place a block. * **Camera**: * **Perspective**: Fixed isometric or high-angle perspective (approx 60 degrees) to show the whole board clearly. * **Responsiveness**: The camera fov (field of view) or distance must automatically adjust based on `window.innerWidth` to keep the entire grid visible on both portrait (vertical) and landscape screens. **Portrait mode is the priority.** * **UI & Feedback**: * **Visual Feedback**: When a tile is tapped, it should scale up slightly (bounce effect) or emit small dust particles to confirm the action. Highlight the tile under the finger/cursor slightly. * **Haptics**: Trigger a short, light vibration (using `navigator.vibrate(10)`) when a block is successfully placed. * **Restart Button**: A large, thumb-friendly restart button (min 44px height) floating at the bottom or top of the screen. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Block the Pig is a captivating puzzle game that combines strategic thinking with adorable animal characters. This brain-teasing challenge features a cute pink pig that you must trap using carefully placed blocks. The game's simple concept belies its increasing complexity, making it perfect for players who enjoy puzzle games that test their problem-solving abilities.

The charming 3D graphics showcase an adorable pig character with expressive golden eyes set against a dreamy sky backdrop. The visual design creates a friendly, approachable atmosphere that appeals to players of all ages while maintaining the mental challenge that puzzle enthusiasts crave.

Core Features

Progressive Difficulty System

Block the Pig features multiple rounds with escalating difficulty levels. Each successful trap leads to a more challenging scenario, keeping players engaged and constantly testing their strategic abilities. The game's difficulty curve is expertly crafted to provide satisfaction without overwhelming frustration.

Strategic Gameplay Mechanics

The core gameplay revolves around predicting the pig's movement patterns and placing blocks to create an inescapable trap. Players must think several moves ahead, considering all possible escape routes while efficiently using their limited resources.

Restart Challenge System

If the pig successfully escapes, the game resets completely, adding stakes to every decision. This mechanic ensures that players remain focused and invested in each round, making every block placement crucial to success.

Brain Training Benefits

  • Spatial reasoning : Visualizing escape routes and block placement
  • Strategic planning : Thinking multiple moves ahead
  • Problem-solving : Finding efficient trapping solutions
  • Pattern recognition : Understanding pig movement behaviors

Gameplay Mechanics

The game presents players with a hexagonal grid where a pig can move freely. Your objective is to place blocks strategically to prevent the pig from reaching the edge of the playing field. The pig follows intelligent pathfinding, always seeking the shortest route to freedom.

Each round begins with the pig in a central position and players having a limited number of blocks to place. Success requires understanding the pig's movement logic and anticipating its chosen escape route. The challenge intensifies as later rounds feature more complex starting positions and fewer available blocks.

Operation Guide

Basic Controls: - Mouse Click : Click on any empty tile to place a block - Strategic Placement : Consider all possible pig escape routes before placing blocks - Visual Feedback : The game provides clear visual indicators for valid block placement

Winning Strategy Tips: 1. Start from the edges : Begin by blocking obvious escape routes near the board perimeter 2. Create bottlenecks : Force the pig into narrow paths where it's easier to trap 3. Think ahead : Consider where the pig will move after you place each block 4. Use minimal blocks : Efficient solutions often require fewer blocks than you might expect

Why Play Block the Pig

Perfect Brain Exercise : This game provides excellent mental stimulation without being overly complex. It's ideal for short gaming sessions that exercise your strategic thinking abilities.

Family-Friendly Fun : The cute pig character and non-violent gameplay make it suitable for players of all ages. Parents and children can enjoy solving puzzles together.

No Pressure Gaming : While challenging, the game maintains a relaxed atmosphere. There are no time limits or pressure mechanics, allowing players to think carefully about their moves.

Highly Addictive : The "just one more round" factor is strong with Block the Pig. Each failed attempt motivates players to try again with improved strategy.

Completely Free : Enjoy the full game experience without any payment requirements or intrusive advertisements disrupting gameplay.

Frequently Asked Questions (FAQ)