private void CHASE(Vector3f direction, float distance)
    {
        double time = (double)Time.getTime()/(double)(Time.SECOND);
        double timeDecimals = time - (double)((int)time);

        if(timeDecimals < 0.25)
            material.setTexture(textures.get(0));
        else if(timeDecimals < 0.5)
            material.setTexture(textures.get(1));
        else if(timeDecimals < 0.75)
            material.setTexture(textures.get(2));
        else
            material.setTexture(textures.get(3));

            if (random.nextDouble() < ATTACK_CHANCE * Time.getDelta()) {
                state = STATE_ATTACK;
            }

            if (distance > 0.9678339649838754968578579f) {
                float moveAmount = MOVE_SPEED * (float) Time.getDelta();

                Vector3f oldPos = transform.getTranslation();
                Vector3f newPos = transform.getTranslation().add(direction.mul(moveAmount));

                Vector3f collisionVector = Game.getLevel().checkCollision(oldPos, newPos, WIDTH, HEIGHT);

                Vector3f movementVector = collisionVector.mul(direction);

                if (movementVector.length() > 0)
                    transform.setTranslation(transform.getTranslation().add(movementVector.mul(moveAmount)));

                if (movementVector.sub(direction).length() != 0)
                    Game.getLevel().openDoors(transform.getTranslation());
            } else {
                state = STATE_ATTACK;
            }

    }