Spelunky by Derek Yu

Although the Shopkeeper is not the literal devil of Spelunky, he certainly is a character who I have, in turn, called an asshole, a shithead, and, ironically, “the literal devil.” For a while I would restart the game over and over again in order to face the Shopkeeper and perfect my method of murdering him and stealing his wares. It was even more important to me to figure out how I would kill the Shopkeeper that spawned at the end of every level after that point, and even though the shotgun-wielding man would come at me with the vengeant fury of a thousand unceremonious murders, I still managed to get pretty good at disarming and defeating him.
With the release of Spelunky by Derek Yu, the creator of the game, we finally know how the Shopkeeper works. We know that the Shopkeeper jumps partially to navigate through pathways and partially because the player character is above him. We know that he can produce a single shotgun only, and he holds it inside of his body until angry. We know that he is, in the heart of his code-based jerk-face soul, a being who can only become angered and never sated.
It’s possible to learn all of this through the tradition of empirical research. I’m sure that the speedrunners and wikicrafters have mined both their experiences and the code itself to tell you exactly what the Shopkeeper or the spider or the giant golden head thing at the end of the game does in any given situation, and it wouldn’t surprise me if people are running weird simulations to figure out the chances of certain scenarios to speed up their times in the game.
There’s something special about Yu writing about the Shopkeeper though. The book is written half as a biography and half as a postmortem on how Spelunky was created, developed, and released from proof-of-concept to full worldwide release. It is a format that is more well-written than your average Gamasutra developer postmortem, but anyone familiar with that genre will find a similar kind of information here in this book.