An HTML5 engine for text-based storytelling games