Role play game

This is a dungeons and dragons simulator, made by me and a friend of mine called Dylan Strudwick. It is slightly remixed from the original rules, but this is how we have done it:

There is an attack class, which stores data about different attacks the player or enemies can use. This includes damage, magic power required, recoil, chance of being used (for enemies)

Next, we have a player and enemy class, which represent the players and enemies in game. We have built a save and load function on the players, but we haven’t implemented them yet.

The parent of all these is the encounter class. This takes care of deciding who’s turn it is when and saying if a certain side has won.

In maps.py, we store the map creation data. A dungeon holds lots of room subclasses. The dungeon will prompt and ask what the player wants to do (north, east, south, west, pickup). Depending on the rooms door data and item ids, the action will be allowed or disallowed. Then, a minimap is printed along with the room map of doors.

We have also implemented save and load functions for the map and player. They are not used yet, just for safe keeping. If you take out the line that says x.load() in main.py, it will create a random map. Feel free to mess around with the save data, I won’t go into any detail here, but if you can work it out that’s great.

View project

4 thoughts on “Role play game

Leave a Reply

Your email address will not be published. Required fields are marked *