My goal for UB Hackathon 2020 is to learn. I decided that I wanted to learn javascript since I have knowledge in HTML and CSS. I am hoping in the future hackathons to come with a more competitive objective.

What it does

My mini-game is a text-based decision making game. You choose your character through one of three different specializations which influence your skills. You may also choose one perk to give some extra benefit to your character. While in the game your goal is to stay alive and advance on your journey. You may utilize currency and parts with the market and crafting system to stay alive. Beware of scenarios where you must choose, your skills matter.

How I built it

The initial page you see is pure HTML. Using inputs and tables and one button with some css styling I get the layout presented. The game loop is mainly javascript with some HTML when writing into the inner html element. I used a player and equipment class and a skills object to implement the player attributes. The "infinite" while youre alive game loop is a recursive call to advance_game() each time the button advance is pressed. Each scenario is in a case call that writes some javascript and html depending on which scenario is selected from a RNG value (0-9). I also try to weigh in the skills for probabilities of certain scenarios and how much you are affected by others.

The game balance isn't great but that is something to work on.

Challenges I ran into

Learning javascript for the first time added some difficulty in figuring out the differences between other programming languages and javascript. It was an obstacle to effectively transition each advance_game() call while ensuring data was validated and verified (by eye - not tests in current version).

Accomplishments that I'm proud of

I am proud that I was able to use a new language to build a "fun" mini-game that utilizes multiple programming concepts (control flow, classes, references).

What I learned

I learned most of the fundamentals in javascript. JS variables, control flow, functions, classes, objects, DOM, JS math. I applied whatever HTML and CSS knowledge I knew previously.

What's next for The Traveler

The reason I am using HTML5 boiler plate is to help with deployment if I decide in the future to make it a web game. Improvements:

  1. Game Balance
  2. Scenario Possibilities (good balance of each different type of possibility)
  3. Use of inheritance when adding more equipment.
  4. Testing suite

Built With

Share this project: