Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Terminal size is smaller than Game #1

Open
gmaciascorrea opened this issue Jun 13, 2022 · 0 comments
Open

Error when Terminal size is smaller than Game #1

gmaciascorrea opened this issue Jun 13, 2022 · 0 comments

Comments

@gmaciascorrea
Copy link
Collaborator

Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/gamcorrea/code/python-console-snake/snake/main.py", line 26, in
run()
File "/home/gamcorrea/code/python-console-snake/snake/main.py", line 20, in run
gameloop.start()
File "snake/gameloop.py", line 44, in start init()
File "snake/gameloop.py", line 63, in init
graphics.draw_game()
File "snake/graphics.py", line 85, in draw_game
draw_borders()
File "snake/graphics.py", line 106, in draw_borders
draw_tile(x, y_top - 1, tile_h, color)
File "snake/graphics.py", line 15, in draw_tile
screen.addstr(y, x, tile, color)
_curses.error: addstr() returned ERR

After running some tests, I got to the conclusion that there was nothing wrong with the code, but with the enviroment (Terminal).
The script runs perfectly if the Terminal is at it's full size, or enough size for the game to fit in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant