Tower Swap - Match-3 Tower Defense

Seele01-Flash
By
Tower Swap is an innovative puzzle game that uniquely combines match-3 mechanics with strategic tower defense gameplay. Match resources to build defenses and protect your castle from endless waves of attacking dragons.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Tower Swap: Pixel Defense**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** * **3D Pixel Art (Voxel-like):** The game should use a distinct 2.5D or isometric voxel aesthetic (similar to Crossy Road but top-down) to mimic the original pixel art style in a 3D environment. * **The Board:** A 6x6 (or similar) grid floating on a stylized terrain. The grid cells should be clearly defined grass tiles. * **The Castle:** Located at the *top* of the screen. A sturdy stone fortress with a gate, serving as the "end point" for enemies. * **The Moat/Path:** Water or dirt paths on the left and right sides of the grid where dragons fly/walk towards the castle. * **Units (Voxel Models):** * **Resources (Basic Tiles):** Stone (Grey cube pile), Gunpowder (Black spheres), Ice (Blue crystal), Logs (Brown wood pile), Gold (Yellow stack). * **Defenses (Upgraded Tiles):** Ballista (from Logs), Cannon (from Gunpowder), Ice Wall (from Ice), Stone Tower (from Stone). All defenses must have a clear "front" facing towards the enemy paths. * **Enemies:** Dragons (Voxel models with flapping wings animation). Small dragons (green/red) and Boss dragons (larger, gold/black). * **Performance:** Use instanced mesh rendering for the grid tiles and projectiles to ensure 60FPS on mobile browsers. Use low-poly geometries with flat shading. ### 2. Audio Requirements * **Background Music (BGM):** A catchy, retro-inspired chiptune track with a "medieval battle" vibe. It should have a loopable marching rhythm. * **Sound Effects (SFX):** * **Swap:** A quick "whoosh" or "slide" sound. * **Match/Merge:** A satisfying "ching" or "power-up" 8-bit sound. * **Attack:** Projectile sounds (arrow thwip, cannon boom, ice shatter). * **Dragon Hit/Death:** A digitized screech or retro explosion sound. * **Castle Hit:** A heavy "thud" or alarm sound when a dragon breaches defenses. ### 3. Gameplay Loop * **Phase 1: Planning (The Swap Phase):** * The game is turn-based initially. The player has a limited number of "Moves" (Swaps) displayed at the top. * **Mechanic:** Swap any two adjacent tiles. * **Match-3 Logic:** Matching 3 resources creates 1 defensive unit (Tier 1). Matching 3 Tier 1 defenses creates a Tier 2 unit (more powerful). Matches consolidate into the position of the last swapped tile or the logical center. * **Special Chests:** Matching Gold generates chests giving extra moves or TNT (clears a tile). * **Phase 2: Defense (The Action Phase):** * When moves run out, the "Day" ends, and the Attack Phase begins. * Dragons spawn from the bottom or sides and move toward the Castle at the top. * **Combat:** Defensive towers automatically fire at enemies within range. * *Ballista:* Single target, fast. * *Cannon:* Splash damage, slow. * *Ice:* Slows enemies down. * *Stone Tower:* block enemies pathing (if enemies walk on grid) or shoots short range. * If a dragon reaches the castle, Player Health decreases. * **Progression:** Survive waves (Days). Every 10th Day is a Boss Level. ### 4. Mobile Controls & Interaction * **Orientation:** Portrait Mode (Vertical) is mandatory for one-handed play. * **Touch Controls:** * **Grid Interaction:** Implement a "Touch-Drag-Release" mechanic for swapping tiles. Raycasting should be precise for detecting which tile is touched. * **Feedback:** When a tile is selected, it should highlight or hop slightly. On a valid swap, play a particle effect. * **Free Swap:** Allow swapping *any* two tiles, even if it doesn't result in a match (unlike traditional Candy Crush rules), but it consumes a move count. * **UI Layout:** * **Top Header:** Castle Health (Hearts), Day Count, Move Counter (large font). * **Center:** The 3D Game Board. * **Bottom:** "Next Wave" button (if player wants to skip remaining moves) and Inventory/Power-up slots. * **Buttons:** Must be at least 44x44 pixels for touch accessibility. Provide visual depression/scale effect on press. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Tower Swap

Tower Swap is a groundbreaking puzzle strategy game that masterfully blends the addictive mechanics of match-3 games with the tactical depth of tower defense. This innovative combination creates a unique gaming experience where every tile swap matters and strategic thinking is essential for survival.

In this pixel-art styled adventure, players must defend their medieval castle against relentless dragon attacks by cleverly matching and merging resources to create powerful defensive structures. The game challenges you to think several moves ahead, balancing immediate needs with long-term strategic planning.

Core Features

Revolutionary Match-3 Tower Defense Hybrid

Tower Swap stands out as one of the first games to successfully merge two beloved gaming genres. Unlike traditional match-3 games focused purely on scoring, every match directly impacts your defensive capabilities. This creates meaningful decision-making where players must consider both puzzle-solving efficiency and strategic defense placement.

Strategic Resource Management

The game features five distinct resource types, each serving a specific defensive purpose: - Stone : Creates defensive attack towers for steady damage output - Gunpowder : Builds explosive cannons for area damage - Ice : Forms protective ice walls to slow enemy advancement - Logs : Constructs rapid-fire attack turrets - Gold : Generates treasure chests containing valuable swaps and upgrade materials

Multi-Level Merging System

Once you've created basic defenses by matching three resources, you can merge three identical defensive structures to create even more powerful units. This creates fascinating strategic dilemmas: do you merge for maximum power or maintain broader coverage across the battlefield?

Dynamic Dragon Threat System

Face increasingly challenging waves of dragons, including special boss encounters on days 10 and 20. The game provides visual indicators showing where boss dragons will appear, allowing for strategic preparation. When defeated, boss dragons release swarms of smaller enemies, requiring different defensive strategies.

Gameplay Mechanics

Limited Swap Strategy

Each round provides a limited number of tile swaps before the dragon assault begins. This constraint forces players to optimize every move, creating tension and requiring careful planning. You can swap any tiles regardless of whether they create matches, offering flexibility in resource positioning.

Progressive Difficulty

The game gradually increases in complexity, introducing new enemy types and attack patterns. Early levels teach basic mechanics, while later stages demand mastery of advanced merging strategies and optimal tower placement.

Social Gaming Elements

Players can create accounts to access additional features including custom avatar creation, clan membership for competitive play, and reward systems that provide gold coins for purchasing lives and opening treasure chests.

Operation Guide

Basic Controls

Tower Swap uses intuitive touch and drag controls that work seamlessly across all platforms: - Tap and drag any tile to swap positions with adjacent tiles - No matching restrictions - swap any tiles to position resources strategically - Visual feedback shows valid defensive placements and merge opportunities

Strategic Tips for Success

  1. Plan your merges carefully - Sometimes maintaining multiple weaker defenses provides better coverage than one powerful unit
  2. Watch for boss indicators - Prepare concentrated firepower where boss dragons will appear
  3. Balance resource types - Different enemies require different defensive approaches
  4. Manage swaps efficiently - Use every swap purposefully before the attack begins
  5. Position ice walls strategically - Slowing enemies gives your towers more time to deal damage

Progression System

Complete daily challenges and defeat dragon waves to earn gold coins. These coins unlock additional lives, early chest access, and other gameplay advantages that help tackle more difficult levels.

Why Play Tower Swap

Tower Swap offers a completely fresh take on two classic gaming genres, creating something genuinely innovative in the puzzle gaming space. The game perfectly balances accessibility with depth - newcomers can quickly grasp the basic matching mechanics while strategy game veterans will appreciate the tactical complexity.

The pixel art style provides charming visual appeal without overwhelming detail, making gameplay elements clear and easy to distinguish. Cross-platform compatibility ensures you can enjoy the game anywhere, whether on desktop browsers or mobile devices.

Most importantly, Tower Swap is completely free to play with no paywalls blocking core gameplay features. The optional account system adds social elements and progression rewards without requiring payment, making it accessible to all players.

Perfect for Strategy Lovers

If you enjoy games that require both quick thinking and long-term planning, Tower Swap delivers an ideal experience. Each level presents a unique puzzle that demands creative solutions and adaptive strategies.

Frequently Asked Questions (FAQ)