2
\$\begingroup\$

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.

\$\endgroup\$
0

1 Answer 1

-1
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

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