@Override
    public void run() {
        while (isRunning) {
            if (direction == 'u') {
                moveCol(-1);
            }

            if (direction == 'd') {
                moveCol(1);
            }

            if (direction == 'l') {
                moveRow(-1);
            }

            if (direction == 'r') {
                moveRow(1);
            }

            eatPellet(pacmanCol, pacmanRow);
            maze.checkCollision();
            maze.repaint();

            try {
                Thread.sleep(150);
            } catch (InterruptedException e) {
                System.err.println(e);
            }
        }
    }