Castle Defense

Seele01-Flash
By
Castle Defense is an enchanting tower defense game where you command mystical sorcerers to defend your kingdom against waves of orcs, goblins, dragons, and other mythical creatures. Build your magical arsenal and upgrade your defenses in this strategic fantasy adventure.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Castle Defense**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Low-poly, cartoon fantasy aesthetic using `MeshToonMaterial` or `MeshLambertMaterial` for a vibrant, flat-shaded look similar to the screenshot. * **Camera Perspective:** Use an **OrthographicCamera** positioned at a high angle (looking down the Z-axis or slightly isometric) to mimic the 2D view of the original game but in 3D space. The camera should be fixed. * **The Castle:** A fortified wall constructed of `BoxGeometry` blocks running horizontally across the bottom of the screen. In the center, a slightly taller Turret/Tower where the player (Magician) stands. * **The Player (Magician):** A stylized character or distinct capsule model on top of the central tower, capable of rotating 180 degrees (facing upwards). * **Enemies (The Horde):** Distinct low-poly models representing Goblins (Green, fast) and Orcs (Larger, slower). They spawn at the top of the screen and move downwards (negative Y axis) toward the castle wall. * **Projectiles:** Glowing spheres or particle trails representing magic missiles/fireballs. * **Environment:** A simple dark grey or stone-textured ground plane. A "fog of war" or fade-to-black effect at the very top of the screen where enemies spawn. * **Performance:** Use **InstancedMesh** for the wall blocks and repeated enemies to ensure 60FPS on mobile devices. Implement object pooling for projectiles and enemies. ### 2. Audio Requirements * **BGM:** A looping, mid-tempo orchestral track featuring brass and percussion, evoking a "heroic defense" feeling. * **Sound Effects (SFX):** * **Shooting:** A magical "Zap" or "Whoosh" sound when the player fires. * **Impact:** A wet "Thud" or explosion sound when projectiles hit enemies. * **Enemy Death:** High-pitched grunts for Goblins, deep groans for Orcs. * **Wall Hit:** A crumbling stone sound when an enemy attacks the wall. * **UI:** crisp "Click" sounds for buttons and a "Ching" sound for collecting gold/upgrading. ### 3. Gameplay Loop * **Phase 1: Preparation/Idle:** The player sees the "Start Wave" button. Health of the wall is at 100%. * **Phase 2: The Wave:** Enemies spawn from random X coordinates at the top of the screen and march straight down. * **Phase 3: Combat:** The player rotates the magician to aim and shoots projectiles. * *Hit Logic:* Projectiles destroy enemies. Enemies that reach the wall decrease the "Wall Health" variable. * *Resource:* Killed enemies drop "Gold" (auto-collected or click-to-collect). * **Phase 4: Upgrade (Inter-wave):** If the wave is cleared, a shop UI appears allowing the user to spend Gold to: * Increase Fire Rate. * Repair Wall Health. * Unlock "Multishot". * **Game Over:** If Wall Health reaches 0, the game ends with a "Kingdom Fallen" screen and a restart button. ### 4. Mobile Controls & Interaction * **Primary Control (Aim & Shoot):** * Implement a **"Touch-Drag to Aim, Auto-fire"** mechanic. * Wherever the player touches on the screen, the Magician character should look at that coordinate (using `Math.atan2` for rotation). * While the finger is held down, the magician automatically fires at a set interval (e.g., every 0.5s). * **Orientation:** Portrait mode is acceptable, but **Landscape mode** is preferred to match the wide wall aspect ratio of the screenshot. Ensure the canvas resizes correctly on window resize. * **UI/HUD:** * **Health Bar:** A visual bar at the bottom representing Wall Health. * **Score/Gold:** Large, readable text in the top corners. * **Interactive Areas:** All buttons (Start, Upgrade) must have a minimum touch target size of 44x44 pixels. * **Feedback:** * **Visual:** When an enemy is hit, flash them white/red for one frame. Display floating damage numbers. * **Haptic:** Trigger `window.navigator.vibrate(50)` when the wall takes damage to alert the player. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Castle Defense

Castle Defense is a captivating magical tower defense game that combines strategic planning with fast-paced action. With a solid 3.4/5 rating , this fantasy defense game challenges you to protect your kingdom using powerful sorcerers and magical weapons against relentless monster invasions.

In this immersive tower defense experience, you'll face waves of diverse enemies including orcs, goblins, bats, and fearsome dragons. Each enemy type requires different tactical approaches, making every battle a unique strategic challenge.

Core Features

Magical Defense System

Unlike traditional tower defense games, Castle Defense focuses on mystical sorcerers as your primary defenders. Each sorcerer brings unique magical abilities and can be equipped with various enchanted weapons to maximize their effectiveness against different enemy types.

Progressive Upgrade System

  • Weapon Arsenal : Unlock and purchase new magical weapons with gold earned from successful defenses
  • Turret Installations : Deploy various defensive turrets to supplement your sorcerers
  • Assistant Recruitment : Hire magical assistants to support your defense strategy
  • Barrack Management : Strategically position your defenders for optimal coverage

Dynamic Enemy Encounters

As you progress, enemies become more powerful and numerous . The game features escalating difficulty that requires careful resource management and strategic thinking to overcome increasingly challenging monster hordes.

Cross-Platform Accessibility

Built with HTML5 technology , Castle Defense runs smoothly on both desktop computers and mobile devices, ensuring you can defend your castle anywhere, anytime.

Gameplay Mechanics

The core gameplay revolves around real-time strategic defense . You start by reacting to initial monster waves, learning enemy patterns and weaknesses. As you gain experience and accumulate gold, you can invest in upgrades that transform your defensive capabilities.

Strategic Resource Management

Success in Castle Defense requires balancing immediate defensive needs with long-term strategic investments. You must decide when to upgrade existing equipment versus purchasing new defensive options.

Escalating Challenge System

The game features a well-designed progression system where enemy strength and numbers increase proportionally to your defensive capabilities, maintaining consistent challenge throughout your gameplay experience.

Operation Guide

Basic Controls

  • Mouse Movement : Pivot and aim your magician at approaching monsters
  • Left Mouse Button : Fire your selected weapon at targeted enemies
  • Menu Navigation : Use mouse clicks to access upgrade menus and equipment selection

Strategic Tips

  • Monitor enemy approach patterns to optimize sorcerer positioning
  • Prioritize weapon upgrades that match your most frequent enemy types
  • Balance offensive upgrades with defensive turret installations
  • Save gold for crucial upgrades during challenging wave sequences

Why Play Castle Defense

Perfect Balance of Strategy and Action

Castle Defense excels at combining tactical planning with real-time action . The game rewards both quick reflexes and strategic thinking, making it appealing to various gaming preferences.

Accessible Yet Challenging

Tagged as an "Easy" game, Castle Defense provides an approachable entry point for new tower defense players while offering enough depth to engage experienced strategists. The progressive difficulty ensures continuous engagement without overwhelming beginners.

Free Fantasy Adventure

Experience a complete magical defense adventure without any cost. The game offers full functionality and content access through your web browser, making it an excellent choice for casual gaming sessions.

Mobile-Friendly Design

Optimized for mobile devices, you can enjoy the full Castle Defense experience on smartphones and tablets, perfect for gaming on the go or during short breaks.

Whether you're a tower defense enthusiast or new to strategy games, Castle Defense offers an engaging magical adventure that challenges your tactical skills while providing hours of entertaining gameplay.

Frequently Asked Questions (FAQ)