@Override
    public void keyPressed(KeyEvent e) {
        
        if (e.getKeyCode() == KeyEvent.VK_UP && snake.getDirection() != Direction.DOWN) {
            this.snake.setDirection(Direction.UP);
        }
        
        if (e.getKeyCode() == KeyEvent.VK_RIGHT && snake.getDirection() != Direction.LEFT) {
            this.snake.setDirection(Direction.RIGHT);
        }
        
        if (e.getKeyCode() == KeyEvent.VK_DOWN && snake.getDirection() != Direction.UP) {
            this.snake.setDirection(Direction.DOWN);
        }
        
        if (e.getKeyCode() == KeyEvent.VK_LEFT && snake.getDirection() != Direction.RIGHT) {
            this.snake.setDirection(Direction.LEFT);
        }
        
    }