[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?



Interesting thoughts, thank you.  I haven’t made any firm selection yet, so I will mull your advice as I proceed.

 

If I can find the time I will take a look at the Pyweek competitions as well, thanks for the reference.

 

Do you know of any 3D library / package that integrates with pygame to display wire-frame cubes?  I’m thinking here about simple cubes-of-cubes with only lines connecting all of the internal and external vertices (no surfaces per se) and perhaps some short text or small graphic element embedded in the center of each sub-cube.  If such a structure can be displayed and scaled up and down and rotated 360 degrees that would be very interesting.

 

Peter

 

From: owner-pygame-users@xxxxxxxx <owner-pygame-users@xxxxxxxx> On Behalf Of BW
Sent: Saturday, July 11, 2020 8:09 PM
To: pygame-users@xxxxxxxx
Subject: Re: [pygame] Can the pygame infrastructure be used for non-graphical text-mode games?

 

You got some good feedback so far for choosing the right tool for the job. I'd like to close the gap regarding Python and pygame, in case you're interest is in using them even if they aren't what might be considered the best tools for the job.

The audiovisual functions and event handling in pygame require a window context. For example, if you want to play sounds you have to open a window. Same with keyboard, mouse and joy events. If you're going to open a window for any of these features, then it makes sense to use the window for the full AV feature set.

pygame does have some niceties that could help with the spatial elements of a 100% game, the geometry primitives and collision detection. You have to model your game's play areas some way, and a spatial layout is one way. There are other choices, so if this is the only reason then you can shop around. Also the clock is very useful if a game wants any kind of timing.

Python itself is just a great choice for anything that doesn't require native binary performance. You could certainly use Python's stdio, or third-party text libraries, with or without pygame (again, if pygame offers some benefit).

I remember seeing an ASCII adventure game during a Pyweek, and I think there were other attempts at text based games. You might like to peruse the past competitions and see what they did.

On 6/17/2020 5:40 PM, pjfarley3@xxxxxxxxxxxxx wrote:

A lot of the old "adventure" games and similar game efforts from the very
early days of computing were strictly text-mode games with no graphics used
(or needed) at all.
 
The old code base for such games wasn't always very well organized or
designed, they just (mostly) worked.  I had a thought that updating such a
game's design and structure with more modern design principles and
supporting architecture would be an interesting exercise.
 
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?
 
IOW, can the pygame keyboard input and screen output processes be replaced
with simple python raw_input() and print() calls?
 
Or am I just looking at the wrong library to use for such games?
 
TIA for your advice and opinion.
 
Peter
--