A backend developer with ZERO game development experience recreated "Plants vs. Zombies" using BMAD-METHOD + AI (Claude Code), achieving 120,000+ lines of Go code with 99.9% AI-generated content.
| Metric | Value |
|---|---|
| Developer Background | Backend engineer, no game dev experience |
| AI Code Generation Rate | 99.9% |
| Go Source Code | 120,000+ lines (388 files) |
| Development Approach | BMAD-METHOD workflow + Claude Code |
| Manual Intervention | Architecture decisions, prompting, review |
This project demonstrates that with proper AI workflow management (BMAD-METHOD), even developers without domain expertise can build complex, production-quality applications. The BMAD-METHOD provides structured PRD โ Architecture โ Epic โ Story workflows that guide AI to generate consistent, maintainable code.
็ฎไฝไธญๆ | English
This project is a faithful recreation of the classic tower defense game "Plants vs. Zombies" (PC Chinese Anniversary Edition), focusing on learning and practicing Go game development. It adopts the modern Entity-Component-System (ECS) architecture pattern, implements type-safe game logic using Go generics, and aims for 100% reproduction of the original front yard daytime level experience.
Key Features:
- ๐๏ธ ECS Architecture - Type-safe ECS framework based on Go generics
- ๐จ Original Animations - Complete implementation of the Reanim skeletal animation system
- โจ Particle Effects - XML configuration-driven particle system
- ๐ Data-Driven - YAML configuration files for game data management
- ๐ฏ High Fidelity - Precise recreation of original game values and behaviors
- โ Game Framework - Scene management, state machine, main loop
- โ Resource Management - Unified image, audio, and configuration loading system
- โ Sun System - Sky drops and sunflower production
- โ Plant System - Planting, cooldown, card selection
- โ Zombie System - AI, movement, attack, health
- โ Combat System - Projectile collision, damage calculation
- โ Level System - Wave management, progress bar, win/lose detection
- โ Reanim Animation System - Original skeletal animation with part transformations
- โ Particle Effects System - Explosions, splashes, dirt particles, etc.
- โ Animation Composition - Multi-animation overlay, track binding, parent-child offsets
- โ Configuration-Driven Animations - YAML configuration for animation compositions
- ๐ป Sunflower
- ๐ฑ Peashooter
- ๐ก๏ธ Wall-nut
- ๐ฃ Cherry Bomb
- ๐ฅ Potato Mine
- โ๏ธ Snow Pea
- ๐ฑ Repeater
- ๐ชด Chomper
- ๐ง Normal Zombie
- ๐ง Conehead Zombie
- ๐ชฃ Buckethead Zombie
- ๐ฉ Flag Zombie
- ๐ฐ Newspaper Zombie
- ๐ Pole Vaulting Zombie
- โ Chapter 1 (Front Yard Daytime) - Levels 1-1 to 1-10
- โ Tutorial System - 1-1 single-row lawn guidance
- โ Special Level - 1-5 Wall-nut Bowling
- โ Conveyor Level - 1-10 Conveyor belt mechanics
- โ Opening Animation - Camera pan, zombie preview
- โ Card Selection Screen - Plant selection, unlock system
- โ Main Menu System - Start Adventure, Quit Game
- โ Pause Menu - Continue, Restart, Return to Main Menu
- โ Shovel Tool - Remove plants
- โ Lawn Mower Defense - Last line of defense mechanism
- โ Level Progress Bar - Flags, final wave notification
- Go Version: 1.24 or higher
- Operating System: Windows / macOS / Linux / Android / WASM
- Memory: At least 2GB RAM
- Graphics: OpenGL 2.1+ support
# 1. Clone the repository
git clone https://github.com/gonewx/pvz
cd pvz
# 2. Download dependencies
go mod download
# 3. Run the game
go run .The game will launch in an 800x600 window.
# Build using Makefile (recommended)
make build # Build for current platform
make build-linux # Build for Linux (amd64 + arm64)
make build-windows # Build for Windows (amd64 + arm64)
make build-darwin # Build for macOS (requires macOS host)
make build-wasm # Build for WebAssembly
# Manual build
go build -o pvz-go .
# Build optimized version (smaller size)
go build -ldflags="-s -w" -o pvz-go .# Generate Windows icon resources (.syso)
make generate-icons
# Package Linux release (with icons and .desktop)
make package-linux
# Build macOS .app bundle (requires macOS)
make build-darwin-app
# Build Android APK
make build-apk
# View iOS icon usage instructions
make ios-icons-infoSee Quick Start Guide for detailed instructions.
- Quick Start Guide - Get started in 5 minutes
- User Manual - Game controls and features
- Development Guide - Code contribution and development guidelines
- Product Requirements Document (PRD) - Complete feature specifications
- Architecture Document - Technical architecture design
Note:
CLAUDE.mdprovides development context for the Claude Code AI tool, containing technical details about ECS architecture, Reanim system, etc., primarily for developers.
pvz/
โโโ main.go # Game entry point
โโโ assets/ # Game resources
โ โโโ images/ # Image resources (spritesheets)
โ โโโ audio/ # Audio resources
โ โโโ fonts/ # Font files
โ โโโ effect/ # Particle configurations
โ โโโ icons/ # Application icons (multi-platform)
โ โโโ windows/ # Windows ico and png
โ โโโ macos/ # macOS iconset
โ โโโ linux/ # Linux multi-size png
โ โโโ ios/ # iOS AppIcon.appiconset
โ โโโ android/ # Android mipmap icons
โ โโโ web/ # Web favicon and PWA icons
โโโ data/ # Externalized game data
โ โโโ levels/ # Level configurations (YAML)
โ โโโ reanim/ # Reanim animation definitions
โ โโโ reanim_config.yaml # Animation configuration
โโโ pkg/ # Core code library
โ โโโ components/ # All component definitions
โ โโโ entities/ # Entity factory functions
โ โโโ systems/ # All system implementations
โ โโโ scenes/ # Game scenes
โ โโโ ecs/ # ECS framework core
โ โโโ game/ # Game core managers
โ โโโ utils/ # Common utility functions
โ โโโ config/ # Configuration loading and management
โโโ scripts/ # Build scripts
โ โโโ build-apk.sh # Android APK build
โ โโโ Info.plist # macOS app configuration
โ โโโ pvz.desktop # Linux desktop entry
โโโ docs/ # Documentation
โโโ .meta/ # Reference materials and metadata
- Language: Go 1.21+
- Game Engine: Ebitengine v2
- Architecture Pattern: Entity-Component-System (ECS)
- Configuration Format: YAML
- Testing Framework: Go native testing
- Go Generics ECS - Compile-time type safety, 10-30% performance improvement
- Reanim Skeletal Animation - 100% reproduction of original animation system
- Data-Driven Design - All game values externalized in configuration
- High-Performance Particle System - DrawTriangles batch rendering
- Left Mouse Button - Collect sun, select plants, place plants
- Right Mouse Button - Cancel plant selection
- ESC Key - Pause/Resume game
- --verbose - Enable verbose logging (debug)
- Select "Start Adventure" from the main menu
- Choose plants on the card selection screen (up to 6-10)
- Wait for sun, select a plant card
- Click on lawn grid to plant
- Defend against zombies, complete all waves
See User Manual for detailed instructions.
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Generate coverage report
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outContributions are welcome! This project is primarily for learning Go game development.
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Create a Pull Request
See Development Guide for detailed guidelines.
โ Completed - Full front yard daytime experience (all 10 levels in Chapter 1)
- โ Epic 1: Game Basic Framework and Main Loop
- โ Epic 2: Core Resources and Player Interaction
- โ Epic 3: Plant System and Deployment
- โ Epic 4: Basic Zombies and Combat Logic
- โ Epic 5: Game Flow and Advanced Units
- โ Epic 6: Reanim Animation System Migration
- โ Epic 7: Particle Effects System
- โ Epic 8: Chapter 1 Level Implementation
- โ Epic 9: ECS Framework Generics Refactoring
- โ Epic 10: Game Experience Improvements
- โ Epic 11: Level UI Enhancement
- โ Epic 12: Main Menu System
- โ Epic 13: Reanim Animation System Modern Refactoring
- ๐ Epic 14+: More levels and features (to be planned)
This project is for learning and technical research purposes only.
See DISCLAIMER.md for important legal notices.
- Workflow Engine: BMAD-METHOD
- Original Game: "Plants vs. Zombies" by PopCap Games
- Game Engine: Ebitengine team
- Development Tool: Claude Code AI
For questions or suggestions, please contact us through:
- Submit an Issue
- Start a Discussion
Notice: This project is for learning and technical research only, not for commercial use. All game resource copyrights belong to their original authors.