Tower Defense

Implement a deterministic tower-defense gameplay loop in Unity with pure C# models.

Updated May 6, 2026
One-click install
npx skills add https://github.com/BasarEkinci/memory-card-game --skill tower-defense-basarekinci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Tower Defense
Source: https://github.com/BasarEkinci/memory-card-game/tree/main/.claude/skills/genre/tower-defense
Command: npx skills add https://github.com/BasarEkinci/memory-card-game --skill tower-defense-basarekinci

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It provides reusable tower-defense architecture patterns so you can implement the core gameplay loop—grid placement, enemy pathing, wave spawning, combat, and economy—without entangling Unity views with deterministic game logic.

Core Features & Use Cases

  • Grid placement that validates and commits: Use a pure C# grid model plus a placement system to handle cell validity, occupancy, and currency checks.
  • Target acquisition and firing: Implement an ITickable tower system that selects enemies by range and targeting mode, then publishes fire events.
  • Waypoint-based enemy pathing: Move enemies along scripted paths and signal when enemies reach the end so lives/health can be deducted.
  • Wave spawning without coroutines: Define wave groups and spawn timing with UniTask, publishing wave started/completed messages.
  • Economy, upgrades, and economy-driven tower progression: Award currency on kills, subtract lives on leaks, and upgrade towers by swapping to the next ScriptableObject definition.
  • Projectile simulation and pooling-friendly execution: Model projectiles in deterministic ticks with hit checks, AoE splash, homing behavior, and pooled runtime integration.

Quick Start

Use the Tower Defense skill patterns to structure your Unity project into pure C# models and ITickable systems, then connect thin MonoBehaviour views to render the grid, towers, enemies, and projectiles.

Frequently Asked Questions about Tower Defense

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I separate deterministic tower defense logic from Unity views?

Use pure C# models for game state alongside VContainer-registered ITickable systems for ticking, keeping Unity MonoBehaviour views thin for rendering and input while core logic remains unit-testable.

How do I schedule wave spawning in Unity without using coroutines?

Schedule wave spawning without coroutines by using UniTask for asynchronous timing, defining wave groups and spawn intervals while publishing wave started and completed events through MessagePipe publishers.

Can I use MessagePipe and VContainer for event-driven combat in Unity 6?

Yes, MessagePipe and VContainer enable event-driven combat in Unity 6 by handling decoupled publishers and subscribers for tower targeting, firing, and projectile impact events across pure C# systems.

What is the best way to implement grid placement and validation for a tower defense game?

Implement grid placement and validation using a pure C# grid model combined with a placement system to handle cell validity, occupancy checks, and currency deductions before committing tower placements.

How do I handle projectile simulation and object pooling in a deterministic Unity architecture?

Handle projectile simulation and pooling by modeling projectiles in deterministic ticks with hit checks, AoE splash, and homing behavior, integrating pooled runtime execution for efficient rendering performance.

How do I upgrade towers using ScriptableObjects in an event-driven Unity architecture?

Upgrade towers using ScriptableObjects by swapping the current tower definition to the next tier, applying economy-driven progression where currency is awarded on kills and deducted during upgrades.