I'm working on a small RPG with Pygame, using Python 3.5.1. I've spent a week trying to find a decent tutorial or example for a dialogue box implementation that would pull dialogue from a source file (eg. an XML file) and support choices, with little success. Of course, getting the data is a trivial task. However, I can't think of a good way to implement the presentation side.

Here's my question: What would be the best way to implement a dialogue system that supports choices, while keeping the code relatively easy to understand?

In case you want to take a peek at the project, the source code can be found here.


1 Answer 1


Well after you draw out the area for all the options and stuff, in python using pygame, you can make an if statement for every choice that there may be and in response pull out a specific (if there is a specific dialogue) piece of the dialogue. Another thing you could do is create a dictionary which would save you time, and run the if statements.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .