game-programming-patterns icon indicating copy to clipboard operation
game-programming-patterns copied to clipboard

Decorator Pattern

Open IceOnFire opened this issue 5 years ago • 0 comments

Hey @munificent,

I just read your book and I loved it. I still have some unanswered questions though, and the main one is: what about the Decorator pattern? Without any experience in game development (but a few years in software engineering) I would say it's a perfect fit for powerups such as FireballShootingMario, or DoubleJumpDude, or even FlamingSword: it allows to easily add and remove these powerups, and even combine them together. Does it have any drawbacks? How to combine it with the State pattern that the Player could already feature?

I would love to read an extra chapter with your take on this subject.

IceOnFire avatar May 30 '20 18:05 IceOnFire