Python Pandemonium

A place to read and write about all things Python. If you want to become a writer for this…

Follow publication

Member-only story

Python RPG (Part 2)

David Torres
Python Pandemonium
Published in
3 min readFeb 22, 2021

--

Photo by Ryan Quintal on Unsplash

Here’s the link to part 1 if you want to code the game from scratch. If you want to skip the tutorial and go straight to the code and read it, here’s the project on GitHub!

By the end of this series of articles, you’ll be able to create something like this:

RPG Game by David Torres
RPG Game by David Torres

If you have any improvements on the code or any suggestions, please let me know. Have fun and enjoy the article!

In the following article I’ll be covering the:

  • Enemy Generator
  • Enemy Attack

Step 3: Enemy Generator

Enemy Name Generator

The enemy generator works like any other function in Python. The function will take “levelBoss” as an argument. This boolean variable will let us know if the enemy we are creating is a boss (True) or a common enemy (False).

To give a name to our monster we have different txt files which are just text files:

  • adjective.txt

--

--

Python Pandemonium
Python Pandemonium

Published in Python Pandemonium

A place to read and write about all things Python. If you want to become a writer for this publication then let me know.

David Torres
David Torres

Written by David Torres

Full Stack Developer | MSc Candidate in Artificial Intelligence | Mexican. LinkedIn: https://www.linkedin.com/in/david-tc/

No responses yet

Write a response