@Override
    protected void process() {
        super.process();
        
        Actor actor = ai.getActor();
        
        int actorX = actor.getMapX();
        int playerX = registry.getClosestPlayerX(actor.getCenterPoint(), registry.getScreenWidth());
        int distance = Math.abs(playerX - actorX);

        if (actor.getIsTryingToMove()) {
            if (playerX > actorX) {
                if (actor.getFacing() != Actor.Facing.LEFT) {
                    actor.moveLeft();
                }
            } else {
                if (actor.getFacing() != Actor.Facing.RIGHT) {
                    actor.moveRight();
                }
            }
        } else {
            if (playerX > actorX) {
                actor.moveLeft();
            } else {
                actor.moveRight();
            }
        }

        //try and move
        int oldMapX = actorX;
        if (actor.getIsTryingToMove()) {
            if (actor.getFacing() == Actor.Facing.RIGHT) {
                actorX += actor.checkCollideRight();
            } else {
                actorX -= actor.checkCollideLeft();
            }
        }

        //we didn't move anywhere - try jumping?
        if (actorX == oldMapX) {
            actor.jump();
        }
        
        actor.setMapX(actorX);
    }