In this series, I talk about design patterns and principles and show you how you can use them to improve the quality of your code. All examples are in Python.
Curated by: ArjanCodes (101 videos)
🧱 Build software that lasts. Join the Software Design Mastery program → https://arjan.codes/mastery. The Composite pattern is one of those design patterns you'll start seeing everywhere once you understand it. In this video, I build a small game engine in Python to explore how the Composite pattern lets you treat individual objects and entire hierarchies the same way. You'll see why this pattern works so well for game scenes, file systems, UI frameworks, menus, and many other tree-like structures. 🔥 GitHub Repository: https://git.arjan.codes/2026/composite. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:10 Every Object Should Behave the Same 3:37 Building the Composite 7:06 The Game Loop 8:20 Building the Level 10:32 Leaf Objects Stay Simple 12:09 Recursive Search 13:47 My Old JavaScript Game 17:17 Pros 17:46 Cons 18:35 When Not To Use Composite 19:11 Final Thoughts #arjancodes #softwaredesign #python