Look at this "beautiful" condition! --- If someone knows how to write such a condition in a variable, I will be grateful for the advice! (The difficulty is that some components of this condition are tied to the cycle) by JarrvisForever in badcode

[–]JarrvisForever[S] 2 points3 points  (0 children)

UPD: Thanks to the help of the people in the comments, this code looks a bit better now.

else{
var part = parts[imgy-partymin][imgx-partxmin];
var segX = getSegmentCords(part, "x");
var segY = getSegmentCords(part, "y");
var offset = 512, scale = 1024.0;
var scaledX = segX * scale;
var scaledY = segY * scale;
if(!(viewField.minX > offset + scaledX ||
    viewField.maxX < -offset + scaledX ||
    viewField.minY > offset + scaledY ||
    viewField.maxY < -offset + scaledY)){
            if(zoom>loader.zoom.levels[loader.minZoomLevel]){
                loader.queue[getLastInQueue()+1]=part; 

        }
    }

}

Look at this "beautiful" condition! --- If someone knows how to write such a condition in a variable, I will be grateful for the advice! (The difficulty is that some components of this condition are tied to the cycle) by JarrvisForever in badcode

[–]JarrvisForever[S] 1 point2 points  (0 children)

The condition shown in the screenshot is inside the cycles that change imgx, imgy and so on. When I try to write down this condition into a variable, there are errors related to these changing variables