OUR EXPERT
QUICK TIP
Part Three!
QUICK TIP
CODING COMBAT
QUICK TIP
LOOT BOXES
Credit: https://github.com/azuregate
Nate Drake wants to dedicate this series to his dad who once told him that no one was ever going to pay him to sit around and play video games.
You can download an example of the code, including items that can change the player’s hit points, from https://github.com/azuregate/ lxfpythontext adventure/blob/main/ nextroom statscript1.py.
Don’t miss next issue, subscribe on page 18!
In programming circles, the mechanism of deriving new classes from existing ones is known as inheritance. The first recorded example of this is with the Simula programming language in 1969, around the same time text adventures were first being created.
If you’ve followed the steps in this tutorial, you’ll see that it allows you to create weapons and enemies. For our Python text adventure, combat mechanics are managed by the procedure fight: