Re:Python – Lightweight snake game running in the console
by vkjv on Tuesday May 19, 2015 @12:40PM
(#9571368)
Nice work! IMHO, Snake is one of the best games to get your feet wet programming. I have very fond memories of writing a snake game on the TI-83. IIRC, my event loop was so slow that I didn't even need any wait states to make the game playable.
Re:Python – Lightweight snake game running in the console
by Tankenstein on Tuesday May 19, 2015 @04:32PM
(#9572944)
Excellent! Just as a tip, when writing curses it's best to run everything in a curses wrapper, so wrap your main function in curses.wrapper(main) basically. If you don't do so, crashing messes up the terminal.
Re:Python – Lightweight snake game running in the console
by johnmaguire2013 on Tuesday May 19, 2015 @04:49PM
(#9573040)
Regarding this, does anyone have tips on how best to do curses layouts that support different window sizes? I'm working on a procedurally generated console game in my free time, using Python + curses, and this is an issue I run into as well.
I've been considering taking some time to try to write some sort of "fluid" or "dynamic" layout framework for curses (i.e. specify percents for width / height, and have it automatically expand). Seems like a giant pain though...
I've been considering taking some time to try to write some sort of "fluid" or "dynamic" layout framework for curses (i.e. specify percents for width / height, and have it automatically expand). Seems like a giant pain though...