DEV Community

Oliver Sjöholm
Oliver Sjöholm

Posted on

Taken to school, writing a python game for the terminal.

I recently signed up for Codecademy and delved into learning Python 3, and all of December became a grueling process of learning something completely new. But after 2 weeks there was no slowing down, and by the end of the month I had reached my first big project: Make your own terminal game.

I had already been playing around with the idea of making a "Choose Your Own Adventure" style game, and when I saw one of the example themes, "High School Simultator", I came up with the idea of blending that with the "roguelike" element of every game having completely randomized NPCs.

It felt like an exciting idea, so I immediately began plotting out how I could make it happen. Another painstaking process of realizing how much work would have to go into this. Zoom 2 weeks forward, and Teen High was born (the name shamelessly stolen from the very creative podcast Dungeons & Daddies season 2).

Image description

I began putting in the essential pieces, like the player, the NPCs and the classrooms. However, very quickly it became a mess of figuring out how to make every part interact, and even more importantly, what was the point?

I had to put down the code, open up Milanote (a visual board tool) and go back to figuring out how things would work. I was getting frustrated that I was spending days just looking at my visual board, adding and removing things, and not writing a single line of code.

Image description

Eventually I decided to just start plopping things in. With the 1–2 punch of being able to stay in the moment and code whatever idea I was working on as long as it was fresh in my head, with going back to the visual board and orient myself with what I would need next, really helped the game take shape. I was finally making visible progress, and it felt really good.

I went from wanting to make everything its own class (School, Library, Gym etc.) to slimming it down, keeping a lot of top level. The Player had to be its own class, as well as the NPCs. From there, all of the different events, like going to class or chatting with people in the hallway, were functions that were defined in the global namespace. I created a separate python document for repeated game functions (named "gafu"), and through loops upon loops and if statements were able to go from giving the player simple one-letter response options, to running their input through a function that could guess what they were trying to say, and ask for clarification. Needless to say, there were a bunch of things added because of "spur of the moment" ideas.

By the end of a 2 week stretch of working on the game, I felt that I was loosing steam, and I could see on my visual board that about half (at least) of the game in my head was left. At this point I knew I needed to hedge my expectations and start cutting down on what was possible. After all, the point was to get comfortable coding, and not to burn myself out.

Image description

I decided to skip some of the chunkier pieces (adding clubs and club activities, navigating cafeteria politics, being able to learn new hobbies, and ask NPCs on dates) and stick to the barebones pieces of going to class, raising your core stats (although the stats were meant to only be viable in the club activites… whoops), and making friends in the hallways.

Now, finally finished (ish), I feel very happy with what I've created. I know that I've learned a lot, having to come up to solutions to problems I created myself. I also know that I have something solid that I can return to later when I've progressed further in the course, and I feel hopeful that I can one day build the Teen High game that I set out to make. For now, it will have to stay in the idealistic world inside my brain.

If you'd like to try it out for yourself, then you can find it on my GitHub:
https://github.com/OllieHolmes/teen_high_game

Top comments (0)