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...

PHP Design Patterns Game: Template Method — The Dungeon Trial

0
Three adventurers stand before the same dungeon. A Warrior carries a shield, a Mage prepares a frost spell, and a Rogue checks the corridor for traps. Each must defeat the guardian...
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...

PHP Design Patterns Game: Visitor — The Village Quest

0
A young adventurer enters a village before facing the guardian of the northern gate. Three locations offer different services: the blacksmith can strengthen weapons, the healer can restore health, and the...

PHP Design Patterns Game : The Singleton Pattern

Welcome to our new series of articles, PHP Design Patterns Game ! In this series, we will explore various design patterns and their implementation in sample and easy games using PHP....

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...

PHP Design Patterns Game: Interpreter — The Runic Gate

0
At the entrance to an ancient dungeon, a wizard discovers a stone gate covered with magical symbols. The inscription is not written in an ordinary language. It contains a sequence of...

PHP Design Patterns Game : The Factory Pattern

Welcome to our new series of articles, PHP Design Patterns Games! In this article, we will explore another creational design pattern, the Factory Pattern. The Factory Pattern is used to create...

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 Observer Pattern

Welcome to our series of articles on PHP Design Patterns Games! In this article, we'll be exploring another popular design pattern, the Observer Pattern. This behavioral pattern is used to establish...