This is an old revision of the document!
Table of Contents
PyGame Terminal
This is a version of a common type of starter program I use for many projects.
It requires PyGame.
The basic idea is that there will be a visible representation of an IBM PC VGA terminal, a DEC VT100 style character set, and so forth. It is a common starting program to replicate any of the BSDGAMES such as Robots, Life, Hack, or any program that requires a portable terminal or where access to the console is not superconvenient (ex. when using an IDE).
There are four basic components:
- main.py
- game.py
- window.py
- the character set
Additionally a small logo can be used, but if you comment out the logo line it still works.
Character Set and Logo
- I use a few different ones depending on the situation. I find that the ones included here are some of the best and/or most useful.
The best source for old character sets is The Ultimate Oldschool PC Font Pack. I usually use an IBM_PC_VGA_8x16_PLUS TTF font. They're easy to work with in Python, Java, and C++. If you can't use TTF on the web there are woff and other versions available too. The plus means you can use unicode and/or ANSI codes which is often the only way to print IBM PC special characters. Perfect for those writing a ZZT clone!
The clacon2 font is also very good: http://webdraft.hu/fonts/classic-console/
main.py
from Window import Window from Game import Game def main(): window = Window() window.setLogo("logo32x32.png") window.setCaption("Basic Console Starter Program") window.setSize(960, 640) window.setFont("PxPlus_IBM_VGA8.ttf", 32) # 32 point font game = Game(window) game.start() if __name__ == "__main__": main()