for (i=0; i<4; i++) { this.x = this.gmapo[0]*64 + int(random(0,62)); this.y = this.gmapo[1]*64 + int(random(0,62)); if (onwater(this.x-1+(i%2), this.y-1+int(i/2))) break; }