I'm making a text adventure, and I want to have pyGame animations and illustrations and a HUD!
How can I insert this console?
Thanks!
I'm making a text adventure, and I want to have pyGame animations and illustrations and a HUD!
How can I insert this console?
Thanks!
I'm pretty sure that's impossible. If you want a console within a Pygame screen then you'll have to write your own, or find one written by someone else (e.g. http://pygame.org/project-pygame-console-287-.html)
For your game, you can use subsurface, for the different screen 'sections'.
Using python 3x will have issues with multiple libraries, that are not precompiled for you. If you can, it will simplify things to Use 2.7 or 2.6. (There is a python2.7 binary, but not on the front page)
A console isn't too hard. You need to break down the components, deciding what you need. Start with a miniproject, implementing features one at a time.
dict()
of strings, for commands, with values of function names.commands = { "n" : move_north, "s" : move_south, "fps" : toggle_fps, "help" : print_help }
On enter, call the dict's value, if key exists:
if cmd in commands:
commands[cmd]()
# same as commands["n"]()
You could even have the console's print_help() use the function docstrings.