[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Can the pygame infrastructure be used for non-graphical text-mode games?



On 18/06/20 12:40 pm, pjfarley3@xxxxxxxxxxxxx wrote:
Is it possible to use the pygame infrastructure to implement text-mode-only
games?  Without having to pick window sizes and resolutions and set fonts
and font sizes, etc., etc., on a graphical surface?

Or am I just looking at the wrong library to use for such games?

I think you're looking at the wrong library. Pygame is all about
graphics (and sound and music). It can produce text, but only by
turning it into graphics using some fairly low-level APIs
(essentially just "draw this string of chars here using this
font and this size").

In my opinion, the best way to do an adventure-style text-only
game in this era is to just use standard I/O and run it in a
console window.

If you want more control over the layout of the text (e.g. showing
a status bar at the top of the screen and things like that) you
could look into a library such as curses.

By the way, do you know about any of the modern text adventure
creation systems such as Inform, TADS and ALAN? There is still a
very active community using and working on these. They're not
based on Python, but they could be useful as a source of ideas
on how to structure Python-based text adventure games.

--
Greg