I really wanna make a text-based game

They’ve always seemed so cool! And I have this big fantasy series I planned for years but never really wrote out that I think would work really well for a plot. I used to use html ~10 yrs ago as a teen on tumblr (yikes) so I’m reviewing that right now–but also plan on learning everything I can from this site! I was wondering if anyone has any advice on what I should learn to be able to accomplish this text-based game goal. Also any advice at all would be welcome! Thank you !

Hello @bltz welcome to freeCodeCamp!

I’d say the most important part is being able to extract the text/gameplay-logic with the HTML/CSS the user sees. This will require knowledge of JavaScript, as it can be used to handle all the logic/dynamic game play elements you desire.

The last thing you want to do is have 500 different HTML pages realize you want to update the style and need to manually update every single one. The easiest way would be to leverage a framework of some kind, which will allow you to focus primarily on the game logic, story and game play, rather than manually dealing with simple stuff.

How you manage the game state/the game itself might require something like a browser api like localStorage so the user doesn’t lose all their progress by refreshing the page.

Other then that, the sky really is the limit. The more complex of a game you want, the more stuff you can/need to integrate.

2 Likes

You’ll need JavaScript and React for making the game Dynamic , or it’s just visuals

Apologies for the late reply, but the best option for a text adventure style game is a language called Inform7.

It handles lots of common needs for this type of game and uses a very expressive, natural feeling syntax. It’s really incredible.

You can achieve the same goals with any language of course, but Inform was custom built for this purpose.

If this is a project to learn web dev with, sure, use JS and HTML etc, but if you want it to be a great interactive fiction game, use Inform7.

1 Like