PHP Design Patterns Game: Flyweight — Defending the Kingdom Against a Goblin Horde

0
The kingdom is under attack. Hundreds of goblins are advancing toward the castle walls, and the royal defenders are preparing for battle.Some enemies are fast scouts carrying small weapons. Others are...

PHP Design Patterns Game: Proxy The Guardian of the Forgottern Vault

0
Welcome back to PHP Design Patterns Game. Today's adventure takes us beneath the ruins of an ancient kingdom, where a legendary treasure is protected by the Guardian of the Forgotten Vault.The...

PHP Design Patterns Game: Bridge — The Elemental Arena

0
Welcome to the Elemental Arena. Warriors arrive carrying swords, bows and staffs. Each weapon can be enchanted with fire, ice or lightning, changing the damage it deals and the effects it...

PHP Design Patterns Game: Facade — Escaping the Cursed Castle

0
Welcome back to PHP Design Patterns Game. Today, our hero enters a cursed castle. The exit is guarded by a locked gate, an ancient trap and a sleeping monster. Escaping requires...

PHP Design Patterns Game: Prototype — Building a Spell Laboratory from Reusable Blueprints

0
Welcome to the Spell Laboratory, a workshop where an alchemist prepares spells before sending them into battle. Each spell has a name, a damage value and a sequence of magical effects....

PHP Design Patterns Game: Factory Method — Recruiting Heroes Without Hard-Coding Classes

0
Welcome back to PHP Design Patterns Game. Our adventure needs heroes, but the recruitment system is becoming difficult to maintain. Every time we introduce a new character class, another conditional statement...

PHP Design Patterns Game: Abstract Factory — Three Worlds, One Adventure Engine

0
Our PHP Design Patterns Game adventure continues with three different worlds: a forest, a frozen kingdom, and a volcanic fortress. Each environment contains its own enemies and rewards, but the player...

PHP Design Patterns Game: The Composite Pattern — A Dungeon of Nested Enemies

0
Welcome to another installment of PHP Design Patterns Game. Today, our dungeon contains individual enemies, enemy squads, and larger groups that contain other groups.The challenge is deceptively simple: how can the...
Isometric dungeon room assembled from walls, floor tiles, torches, an archway, and a treasure chest.

PHP Design Patterns Game: The Builder Pattern — Construct a Dungeon One Room at...

0
Welcome back to PHP Design Patterns Game, our practical series exploring software design through small, playable examples.Today we are building a dungeon.A dungeon room may contain enemies, treasure, traps, and an...
Pixel-art RPG character equipped with configurable items, illustrating object-oriented game composition.

PHP Design Patterns Game: The Command Pattern — Undo and Replay Player Actions

0
Welcome back to PHP Design Patterns Game!In our previous installment, we explored how the Decorator Pattern allows a game character to acquire additional capabilities without creating a separate class for every...