Skip to content

Error when Terminal size is smaller than Game #1

@gmaciascorrea

Description

@gmaciascorrea

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions