Over the Christmas holidays of 2016 I played the game Firewatch https://www.firewatchgame.com/ ,it reminded me of the classic Interactive Fiction games of old, a genre I discovered that is still alive and well https://ifcomp.org/comp/2016, it also led me to this documentary which whilst it might be a big long and nerdy for some I also really enjoyed https://www.youtube.com/watch?v=o15itQ_EhRo
This all got me thinking that creating my own Text based Adventure game would be an excellent project for learning Angular 2+ and Typescript, so I started work on “The Shivers”. It’s a short game, but has enough in it to encompass several core Angular / Typescript concepts, manipulating dom, data and incorporating Dependency Injection, Services, Components and Directives. The game is entirely driven from a model so multiple games can be built without needing to touch the code. At the core of this is what I’ve started to call a decision engine, here’s a snippet.
{
"action":"Insert mouthpiece into the horn",
"conditions":{"areCarrying":["HUNTING_HORN","MUSICAL_MOUTH_PIECE"]},
"results":{"message":"You now have a playable hunting horn.","take":["PLAYABLE_HORN"],"destroys":["MUSICAL_MOUTH_PIECE","HUNTING_HORN"]}
}