public void move(boolean isLeft) {
        if (this.getLeft() <= 0 && moveInt == 1) {
            this.setMoveInt(0);
            x = 1;
        } else if (this.getRight() >= 500 && moveInt == 2) {
            this.setMoveInt(0);
            x = 499 - width;
        }
        if (isLeft) {
            x -= 5;
        } else {
            x += 5;
        }
    }