OK, I’m a little pumped about getting back into my Python programming and gaming. Therefore, you get another quick update!
So in short, I have basic defensive and offensive stats up and running, as well as a special “Duel” class that facilitates battle actions. That’s right, this game is going to feature a 1-on-1 combat set-up. Basically, my “Duel” class takes the two combatants (player and enemy) and then “steps” through the different actions each entity is to take (attacks, after-turn effects, etc.). It was interesting to code: I wanted it to be able to progress through all necessary actions (attacks, after-turn effects, etc.) but I also didn’t want it to fly through them all at once. Often one might want to display text (“You were hit! 20 damage!”) or show attack animations. I came up with a relatively easy system: basically, a step consists of one player doing one action. After each step, the Duel system returns information based on what the entity sent back itself on that particular action; that way, if the entity sees it lost 20 health, I could structure my code to have the entity ripple the text prompt “You lost 20 HP!” up the chain for a display class to grab and render.
So though some AI-related stuff isn’t there yet, I basically have a skeletal combat system! Feels pretty great to see the basics coming together already, but I still have a long way to go. But it has felt good to get back into it with Python and game-making in general… hopefully I can continue this momentum moving forward.
So get ready to duel, gamers…