def move(self):
old_x, old_y = self.snake[-1]
dir_x, dir_y = self.snake_direction
new_x = old_x + dir_x
new_y = old_y + dir_y
# Kontrola vylezení z hrací plochy
if new_x < 0:
exit('GAME OVER')
if new_y < 0:
exit('GAME OVER')
if new_x >= self.width:
exit('GAME OVER')
if new_y >= self.height:
exit('GAME OVER')
new_head = new_x, new_y
self.snake.append(new_head)
del self.snake[0]