Return of the Consoles: Recreating Pokémon in Python

Return of the Consoles: Recreating Pokémon in Python hackernoon.com5 years ago in #Dev Love43

Originally published by Jonathan Haines on September 21st 2017 There are certain instances in my childhood that stand out above the rest. A good number of these involve some sort of video game, with my face glued to a screen. One of the earliest games I could remember was King’s Quest VI, a choose your own adventure game that ran on probably the first computer I ever touched. A few years later, I remember heading to the Toys ‘R’ Us in Sheepshead Bay, where I would make arguably one of the biggest decision a kid in Brooklyn could make in the mid-1990’s — Red version or Blue. decisions… decisions… Fast forward to 2017. For the majority of my coding journey, I’ve tinkered with mostly JavaScript-related stuff. Node has been my backend of choice and React has been my favorite library. But when there’s so much excitement about a little thing called Python, that is knowledge I couldn’t ignore. The Python Experiment It’s not all bad, Dr. Jones To be honest, my interest in Python came more from machine learning and data scraping. Beautiful Soup is fantastic, and the ease of the language makes it so much more attractive to use on a backend, despite having more experience in Node. But while Python has all these more practical features, there will always be room for a short project that tugs at my nostalgia. So I took a couple days to try and make a console application. Why a console application? The terminal is an oft disregarded program that’s use is either for working with Git (for developers) or for completely ignoring in case you cause your computer to blow up (for the non-techies). Becoming comfortable with the console is what all programmers to strive for, and the lack of a true GUI allows the creator to focus solely on what his or her code is doing, and not how it looks on a particular browser. As I scoured the Internet for more examples of what other developers have done in the console, I saw plenty of fantasy-driven storylines, where the hero grabs a sword at some point and fights a dragon. This is all well and good. My original idea was to do something The Legend of Zelda-related. This sort of adventure seemed to fit the bill of a choose your own adventure game. However, the memory of that Toys ‘R’ Us trip in ’97 kept coming back to me. such top-notch graphics right there Making decisions is at the heart of the Pokémon formula. While Link deals with adding inventory and fighting enemies, the basis of Pokémon falls on which creature you’ll start with, and how this decision will impact your future as a trainer. The overall code runs pretty simply. The main() function runs in the bottom of the code, then calls the functions that above it. Each decision is a function that features a future function at the bottom of it. At the moment, it is not the most complicated decision tree, but it manages to currently have over a half-dozen outcomes depending on your choices. The code runs in the terminal with the use of a virtual environment, something that I was unfamiliar with, coming from the JavaScript world. my start screen I had a blast creating this mini-application, but it is,  » Read More

Like to keep reading?

This article first appeared on If you'd like to keep reading, follow the white rabbit.

View Full Article

Leave a Reply