I am an amateur playing around with making simple games using Python and the Windows console through sys.stdout.write(). I am aware that this method of doing 'graphics' with printing ascii characters to the console is much slower than using the graphics card, but I have just been enjoying this simple project as I get my feet wet.
Does anyone have advice on ways to speed up the frame print time. Currently, I have every character on the console stored in a dictionary. The dictionary is iterated through, using the x,y coordinates as keys, and each character is appended to a String each frame that is printed to the console. With minimal game logic and 'graphics', I'm already down under 60 frames. I was wondering if it would be at all faster to use threading or multiprocessing to isolate printing the frame to the console (or converting my dictionary into a string) to speed up the time to each frame. I gave it a go myself, but printing to the console on a separate thread using 'threading' made no difference, and I couldn't get multiprocessing to work with a Queue to refresh each frame. If anyone has any advice on ways I could speed up my frame time, I'd appreciate it. If you got this far thank you for reading!
The Current Game Window showing FPS and Number of Ascii Characters in the bottom left
Here is a github link to my current code for reference:
The code is a little messy but the main drawing parts are at the end of the main loop and then the Ascii dict is modified in windowsConsoleGraphics.py