Like a King - Tower Defense Strategy Game

Seele01-Flash
By
Like a King combines tower defense strategy with card deck building mechanics. As a royal commander, collect and deploy unique unit cards to defeat enemy kings in tactical battles.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Like a King**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Create a vibrant, cartoonish "Low Poly" aesthetic with bold, saturated colors (reminiscent of Clash Royale). Use flat shading for a clean look. * **Camera:** Use an Orthographic Camera positioned at a fixed isometric angle (e.g., 45 degrees) to simulate a 2.5D battlefield view. The camera should not rotate but can have a slight "shake" effect upon base damage. * **Battlefield:** A grid-based tile map divided into two halves: the Player's Kingdom (Bottom, Blue theme) and the Enemy's Kingdom (Top, Red theme). * **Tiles:** Simple rounded squares. Empty tiles are grey. Occupied tiles show building bases. * **Background:** A stylized, non-distracting fantasy landscape (green rolling hills or clouds) to frame the play area. * **Units & Structures (Represented by Simple Geometries for performance):** * **The King/Base:** A large, central tower with a crown on top. (Player: Blue Crown, Enemy: Red Crown). * **Mining Unit:** A small cube with a pickaxe animation or gold particle effect. * **Attack Unit (Knight):** A cylinder or capsule with a sword/shield attachment. * **Projectile:** Simple spheres. * **Performance:** Limit geometry complexity. Use `InstancedMesh` for tiles and recurring units to ensure 60fps on mobile devices. ### 2. Audio Requirements * **BGM:** An orchestral, marching-style track that is upbeat and heroic. It should loop seamlessly. * **SFX:** * **Spawn:** A "pop" or magic "whoosh" sound when a unit is placed on a tile. * **Gold Mining:** A rhythmic "clink" sound (subtle) indicating resource generation. * **Attack:** Cartoonish sword clashes or arrow release sounds. * **Damage/Impact:** A punchy thud or "grunt" sound. * **Win/Loss:** Fanfare trumpets for victory; a comedic "sad trombone" or collapsing sound for defeat. ### 3. Gameplay Loop * **Resources:** The player automatically gains "Gold" over time. Mining units placed on tiles increase the rate of gold generation. * **Spawning:** The player selects a card (unit type) from a bottom UI deck and taps an empty tile on their side to build a structure (Miner or Barracks). * **Combat Logic (The "Draw Line" Mechanic):** * Units spawn automatically from Barracks. * **Action:** The player draws a line from their building to an enemy building. This sets the target. * Soldiers march along the path to the target building and attack it. * **Win/Loss Condition:** Destroy the enemy King's main tower to win. If the player's King tower is destroyed, the game is lost. * **AI Behavior:** The enemy AI should periodically spawn units and send attacks toward the player's buildings, requiring the player to defend or counter-attack. ### 4. Mobile Controls & Interaction * **Screen Orientation:** **Portrait Mode** (Vertical) is mandatory for one-handed play. * **Touch Controls:** * **Tap:** Tap a card in the deck to select it, then tap a tile to build. * **Drag/Swipe:** Implement a distinct "Draw Line" gesture. Raycast from the touch start point (Player Building) to the touch end point (Enemy Building) to create an attack vector. Render a visible arrow or dotted line during the drag to show the intended path. * **UI Layout:** * **Top:** Enemy Health Bar and King Avatar. * **Middle:** The Isometric Battlefield (interactive area). * **Bottom:** Player Health Bar, Gold Counter (Large, readable font), and the Card Deck (Horizontal scroll or fixed slots, minimum button size 48x48px). * **Feedback:** * **Haptic:** Trigger a light vibration when a building is placed or destroyed. * **Visual:** Highlight valid tiles in green when dragging a card. Flash buildings white when they take damage. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Like a King is an innovative strategy game that masterfully blends tower defense mechanics with card deck building elements. In this engaging tactical experience, you step into the role of a powerful king who must prove their dominance through strategic warfare against rival monarchs. The game features a unique collection-based combat system where every unit is represented by a collectible card with distinct abilities and tactical applications.

Core Features

Revolutionary Card-Based Tower Defense

Unlike traditional tower defense games, Like a King introduces a sophisticated card collection system. Each unit in your arsenal is a unique card with specific strengths, weaknesses, and special abilities. This creates endless strategic possibilities as you build and customize your deck.

Diverse Unit Types and Abilities

Your card collection includes various unit types designed for different tactical roles: - Combat Units : Frontline fighters that directly engage enemy forces - Economic Units : Gold miners that generate resources for your war effort
- Support Units : Trap layers and defensive specialists that control the battlefield - Special Ability Cards : Unique units with powerful effects that can turn the tide of battle

Dynamic Battlefield Strategy

Every battle requires careful planning and real-time tactical decisions. Position your units strategically, manage your resources wisely, and adapt your tactics based on enemy movements and compositions.

Quest System and Progression

Complete challenging quests to earn rewards, unlock new cards, and strengthen your deck. The progression system ensures continuous engagement as you work toward building the ultimate royal army.

Gameplay Mechanics

Strategic Unit Deployment

The core gameplay revolves around tactical unit placement and resource management. You must carefully consider each unit's position, timing of deployment, and synergy with other cards in your deck.

Real-Time Combat Control

Once units are deployed, you maintain direct control over their actions. Draw attack lines to designate targets, coordinate group assaults, and execute complex tactical maneuvers to outmaneuver your opponents.

Deck Building and Customization

Between battles, refine your deck composition based on your playstyle preferences and the challenges you face. Experiment with different unit combinations to discover powerful synergies.

Operation Guide

Basic Controls

  • Unit Deployment : Tap empty battlefield tiles to spawn units from your hand
  • Attack Commands : Draw lines from your units to enemy targets to initiate attacks
  • Tactical Review : Pause and assess the battlefield situation before making critical decisions
  • Resource Management : Monitor your gold and card resources throughout each battle

Winning Strategies

  • Balance offensive and defensive units in your deck composition
  • Prioritize economic units early to ensure steady resource flow
  • Use trap units to control enemy movement and create tactical advantages
  • Adapt your strategy based on opponent deck types and battlefield conditions

Why Play This Game

Like a King offers a fresh take on both tower defense and card game genres, creating a unique hybrid experience that appeals to strategy enthusiasts. The game is completely free to play through your web browser, requiring no downloads or installations. Its intuitive touch controls make it equally enjoyable on desktop computers and mobile devices.

The combination of collectible card mechanics with real-time strategic combat creates deep gameplay that rewards both tactical thinking and quick decision-making. Whether you're a tower defense veteran or new to strategy games, Like a King provides an accessible entry point with surprising depth.

The quest system and deck building elements ensure long-term engagement, while the variety of unit types and tactical possibilities keep each battle fresh and exciting. Join the royal battle and prove yourself as the one true king!

Frequently Asked Questions (FAQ)