Skip to content

border issues in snake game #4

Description

@BonfaceKilz

When you hit the top, right, or bottom border, you get:

Traceback (most recent call last):
  File "main.py", line 5, in <module>
    wrapper(menu)
  File "/usr/lib/python3.6/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/bonface/SideProjects/python_curses_games/menu.py", line 17, in menu
    display(stdscreen, items)
  File "/home/bonface/SideProjects/python_curses_games/menu.py", line 38, in display
    key_game_launcher(key, items, selected, stdscreen)
  File "/home/bonface/SideProjects/python_curses_games/menu.py", line 57, in key_game_launcher
    items[key](stdscreen)
  File "/home/bonface/SideProjects/python_curses_games/games/snake.py", line 118, in snake_game
    snake.loop()
  File "/home/bonface/SideProjects/python_curses_games/games/snake.py", line 113, in loop
    self.snake[0][1], curses.ACS_CKBOARD)
_curses.error: addch() returned ERR

When you hit the left button, you are taken to the menu, regardless of whether the game has ended or not. The screen isn't also cleared.

IMO, it should present you with an option to either restart the game or quit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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