Tower Swap - Match-3 Tower Defense Game

Seele01-Flash
By
Tower Swap is an innovative puzzle game that brilliantly combines match-3 mechanics with strategic tower defense gameplay. Defend your castle from dragon attacks by matching resources, building defenses, and making tactical merging decisions.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Tower Swap". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: 2.5D "Pixel Art" aesthetic. Use `THREE.OrthographicCamera` to simulate a top-down, retro 2D view while using 3D geometry. * **Models & Geometry**: * **Grid**: A 6x6 (or 5x6) board of textured tiles representing the battlefield. * **Tiles**: Simple `BoxGeometry` with pixel-art textures for resources: **Logs** (Brown), **Stone** (Grey), **Ice** (Cyan), **Gunpowder** (Black), **Gold** (Yellow). * **Defenses**: Distinct 3D models (voxel-style or extruded sprites) for upgraded units: Turrets (from Logs), Attack Towers (from Stone), Ice Walls (from Ice), Cannons (from Gunpowder). * **Enemies**: "Dragons" represented as red/green voxel sprites or low-poly flying models. * **Background**: A 3D Castle structure at the top (the objective to protect) and animated water shaders (using simple vertex displacement) on the left and right sides. * **Effects**: * Particle explosions when tiles merge. * Projectile trails for tower attacks. * Floating text for damage numbers. * **Performance**: Mobile-first optimization. Use `THREE.InstancedMesh` for grid tiles and repeating enemies. Limit texture sizes to 512x512. ### 2. Audio Requirements * **BGM**: A loopable, adventurous **8-bit Chiptune** track. It should be upbeat during the "Swap Phase" and switch to a faster, more intense tempo during the "Defense Phase". * **SFX**: * **UI**: crisp "blip" for button presses. * **Interaction**: A "whoosh" sound for tile swapping. * **Gameplay**: * "Retro Power-up" sound for merging items. * "Explosion/Impact" sounds for cannon fire and dragon hits. * "Crumble" sound when the castle takes damage. ### 3. Gameplay Loop The game operates on a **Day/Wave Cycle**: 1. **Swap Phase (Strategy)**: * The player has a limited number of "Moves" (e.g., 5 moves per day) displayed on UI. * **Unique Mechanic**: Unlike traditional Match-3, **any tile can be swapped** with an adjacent tile, even if it doesn't result in a match. This is crucial for tactical positioning. * **Merge Logic**: Lining up 3 identical resources horizontally or vertically instantly merges them into a single **Defense Unit** of the corresponding type (e.g., 3 Gunpowder -> 1 Cannon). The merged unit appears at the position of the last swapped tile. * **Tier 2 Merge**: Lining up 3 Defense Units merges them into a specialized "Tier 2" Super Tower. 2. **Defense Phase (Action)**: * Once moves run out (or player hits "Fight"), the "Day" begins. * Dragons spawn from the top/sides and fly toward the Castle (bottom or top depending on camera orientation). * Towers auto-attack enemies within range. * **Ice Walls** act as blockers that dragons must destroy to pass. * **Chests** (from Gold matches) open to give bonus items (TNT, extra moves). 3. **Win/Loss**: * **Win Wave**: Defeat all dragons to advance to the next Day. * **Loss**: If dragons reach the castle and deplete its HP (Hearts), the game ends. ### 4. Mobile Controls & Interaction * **Touch Controls**: * Implement a `Raycaster` for grid interaction. * **Swipe to Swap**: Detect touch start and touch end to determine swipe direction (Up, Down, Left, Right). * **Tap to Select**: Alternatively, tap one tile, then tap an adjacent tile to swap. * **UI Layout (Portrait Mode)**: * **Top Bar**: Hearts (HP), Day Counter, Gold Count. * **Main Area**: The Game Grid (vertically centered). * **Bottom Bar**: "Moves Remaining" counter and a large, thumb-friendly "FIGHT / NEXT WAVE" button (min-height 60px). * **Feedback**: * **Haptic Feedback**: Trigger `navigator.vibrate(50)` on a successful merge or when taking damage. * **Visual Feedback**: Selected tile should highlight or "bob" up/down. Invalid moves (if any) should shake the tile. * **Camera Shake**: Screen shake effect when the Castle takes damage or a Boss Dragon appears. 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 revolutionizes the tower defense genre by seamlessly blending match-3 puzzle mechanics with strategic defense gameplay. This unique combination creates an engaging experience where every tile swap matters in your battle against incoming dragon waves. The game challenges players to think tactically about resource management while maintaining the satisfying puzzle-solving elements that make match-3 games so addictive.

The pixel art style gives Tower Swap a charming retro aesthetic, while the strategic depth keeps players engaged for hours. Whether you're a fan of puzzle games or tower defense, this innovative mashup offers something entirely fresh and exciting.

Core Features

Revolutionary Gameplay Fusion

Tower Swap stands out as one of the few games that successfully combines two beloved genres. The match-3 mechanics aren't just a gimmick – they're integral to your defensive strategy. Every move you make on the puzzle board directly impacts your castle's defenses.

Strategic Resource Management

The game features five distinct resources, each serving a unique defensive purpose: - Stone : Creates defensive attack towers for steady damage output - Gunpowder : Builds powerful cannons for explosive area damage - Ice : Forms protective ice walls to slow dragon advances - Logs : Constructs attack turrets for consistent firepower - Gold : Generates treasure chests containing valuable swaps and upgrade items

Dynamic Merging System

Once you've matched three resources to create a defense unit, the strategic decisions continue. Merging three identical defense structures creates even more powerful units, but reduces your map coverage. This creates fascinating tactical dilemmas about when to merge and when to maintain broader defensive coverage.

Progressive Challenge System

Tower Swap features escalating difficulty with special boss encounters on days 10 and 20. The game provides strategic warnings by showing arrows indicating where dragons will appear before boss rounds, allowing players to optimize their defensive positioning.

Game Mechanics

Match-3 Foundation

The core puzzle mechanics are intuitive – match three identical resources to upgrade them into defensive structures. However, the strategic layer adds depth that goes far beyond traditional match-3 games. You have limited swaps before each dragon wave, making every move crucial.

Tower Defense Strategy

Positioning is everything in Tower Swap. You must consider dragon paths, defensive coverage, and merger opportunities simultaneously. The game rewards players who can balance immediate defensive needs with long-term strategic planning.

Boss Encounters

Boss dragons present unique challenges, releasing swarms of smaller dragons upon defeat. This creates intense moments where your carefully planned defenses face their ultimate test.

Operation Guide

Basic Controls

Tower Swap uses simple tap-and-drag controls that work perfectly on both desktop and mobile devices. Any tile can be swapped regardless of whether it creates a match, providing maximum strategic flexibility.

Building Your Defense

  1. Match Resources : Combine three identical resource tiles to create defensive structures
  2. Strategic Placement : Position your defenses to maximize coverage and effectiveness
  3. Smart Merging : Combine three identical defense structures for powerful upgrades
  4. Boss Preparation : Watch for directional arrows indicating boss spawn locations

Resource Strategy

  • Early Game : Focus on basic resource matching to establish initial defenses
  • Mid Game : Balance merging for power versus maintaining coverage
  • Late Game : Prepare concentrated firepower for boss encounters while maintaining area defense

Advanced Tips

  • Save gold chests for critical moments when you need extra swaps
  • Ice walls are particularly effective for controlling dragon movement
  • Plan your merges carefully – sometimes wider coverage beats concentrated power

Clan System and Progression

Tower Swap features a robust progression system with clan functionality. Players can create custom avatars, join clans for competitive play, and earn rewards through successful defensive campaigns. The gold coin system allows for strategic resource management between games.

Why Play Tower Swap

Unique Gaming Experience

Tower Swap offers something genuinely new in the crowded mobile gaming space. The combination of match-3 puzzles with tower defense creates engaging gameplay that appeals to fans of both genres while attracting players looking for innovative experiences.

Perfect for All Skill Levels

The game's intuitive match-3 foundation makes it accessible to casual players, while the strategic depth provides endless challenges for hardcore gamers. The progressive difficulty curve ensures players are constantly engaged without feeling overwhelmed.

Cross-Platform Accessibility

With full support for web browsers, Android, and iOS devices, Tower Swap delivers a consistent experience across all platforms. The simple control scheme works equally well with mouse clicks or touch gestures.

Free-to-Play Value

Tower Swap is completely free to play with no paywalls blocking core content. The optional account system adds value through clan features and progression tracking without requiring payment.

Endless Replayability

The combination of randomized resource layouts, escalating difficulty, and strategic depth ensures that no two games play exactly the same. Each defensive campaign presents new challenges and opportunities for creative problem-solving.

Frequently Asked Questions (FAQ)