public void move() {

        if (visible) {
            timer++;
            y += dy;
            //every few seconds the this conditional becomes true and the boss fires
            if (timer % 100 == 0) {
                fire();
            }
            //the speed changes as the boss progresses throught the map
            else if (timer % 75 == 0) {
                dy = 4;
            }
            if (y >= 500) {
                dy = -2;
            } else if (y <= 100 && dy < 0) {
                dy = 0;
            }

            if (hp <= 0) {
                visible = false;
            } else if (hp == 500) {
                dx = 3;
            }
            if (left) {
                x -= dx;
            }
            if (right) {
                x++;
            }

            if (x <= loopx1) {
                right = true;
                left = false;

            }
            if (x >= loopx2) {
                left = true;
                right = false;
            }
        }

    }