I recently programmed a browser minigame for my Nocturna project. Narrative framing makes what is essentially a randomly-generated set of HTML elements into a game with the potential to generate enjoyment, to entertain.

A simple randomly-generated grid of squares becomes an environment via this narrative. I situate a controllable character (an audience surrogate of sorts) with skills within the map, introduce conflict in the form of enemies that can kill the player, and a create goal in the form of a treasure to be found.

Certain elements strengthen the illusion: squares are turned into terrain through design (pixel art backgrounds) and programming (making some tiles impassable).

Flavour text and varying powers give the characters personality.