Proxy for Sprite Enchantment
A spectral placeholder controlling access to a resource-heavy enchanted sprite.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Illusion // Sprite Enchantment
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
function HeavyEnchantment() constructor {
// Imagine loading a massive texture atlas here
sprite_index = spr_massive_boss_aura;
static draw = function(_x, _y) { draw_sprite(sprite_index, 0, _x, _y); };
}
function ProxyEnchantment() constructor {
real_enchantment = undefined;
static draw = function(_x, _y) {
if (real_enchantment == undefined) {
real_enchantment = new HeavyEnchantment(); // Lazy instantiation
}
real_enchantment.draw(_x, _y);
};
}
The Proxy weaves an illusion of presence. It postpones the severe memory cost of heavy magical assets, materializing the true enchantment only at the precise moment it is required to be perceived by mortals.
Runic Tags:
#gml
#structural
#proxy