Explain a design pattern and show how to apply it in a game development context
Explains a design pattern with game development examples, pseudocode, trade-offs, and real-world applications.
/plugin marketplace add sponticelli/gamedev-claude-plugins/plugin install engineering@gamedev-claude-pluginsExplain how to use a specific pattern for game development.
# Pattern: [Name]
## What It Is
[2-3 sentences explaining the core concept]
## When to Use in Games
- [Use case 1]
- [Use case 2]
- [Use case 3]
## When NOT to Use
- [Anti-pattern 1]
- [Anti-pattern 2]
## Implementation
### Core Structure
```pseudo
// Engine-agnostic pseudocode
class [PatternName] {
// Key elements
}
// Specific game example
## Common Patterns to Cover
- State Machine
- Component/Entity-Component-System
- Command Pattern
- Observer/Event System
- Object Pool
- Flyweight
- Service Locator
- Factory
- Strategy
- Singleton (and why to avoid it)
- Double Buffer
- Game Loop
- Update Method
- Dirty Flag
- Spatial Partition
Explain the pattern the user asks about.