Take a Path
A "game engine" for creating a simple choose your own adventure game on the web.
August 2021 — September 2021
Summary
A "game engine" for creating a simple choose your own adventure game on the web.
Background
This was my first experience building a site that is interactive using Javascript. Prior to this project, I was only able to make static site purely using HTML and CSS. I had learned about Javascript and how to use Javascript to solve problems (I ported many of my Python codes to Javascript in order to learn the language), but I didn't know how to use Javascript for building a site. In some ways, this is also a port of my Python codes considering that a simple CLI game I made with Python was the inspiration for me to make this.
Developer Diary
Incorrect Naming Style
Coming from Python, I was using snake_case for all of the variables and functions (as one do in Python) whish isn't in line with the style guide of Javascript that mandate the use of camelCase. I only learned to use camelCase in my projects after this one and I can say it's much better to write camelCase than snake_case.
OCP Before I Knew OCP
Although the code I wrote here is certainly not tidy at all, I'm still proud of the fact that I implemented OCP before I even knew what OCP was. The story in this program is not hard coded, but it is represented by classes and the connection between them in the file story.js
and config.js
. By no means it's a good DX experience for any story writer that uses this but I'm still proud of it.
Pain
Making a site, even as simple as this, without using a framework is pain.