I'm trying to write a console (as in the terminal, not in the game console) a python pong game, and it's hard for me to figure out how best to (re) play the game.
I thought that a 2d array is a kind of bitmap, editing an array to reflect the ball / paddles new positions, and then throwing each line into a line and printing it. However, this means that the old βframesβ will remain, and if the game is smaller than the console window, the old frames will still be visible.
Is there a way to remove characters from the console? '\ b' I heard it is unreliable.
Or is there a simpler alternative way to output such an application to the console?
python stdout console
Jibmo
source share