length/2){ animal[i].setIsLeft(true); } else{ animal[i].setIsLeft(false); }} for(int i=0;i<stone.length;i++){ stone[i]=new Stone(); pCenter.add(stone[i]); stone[i].setSize(distance*8/9,18); int w=stone[i].getBounds().width; int h=stone[i].getBounds().height; stone[i].setLocation(point[i].getX()-w/2,point[i].getY()); point[i].setThisStone(stone[i]); } for(int i=0;i<animal.length;i++){ animal[i].setSize(distance*6/7,distance*3/4); int w=animal[i].getBounds().width; int h=animal[i].getBounds().height; pCenter.add(animal[i]); if(i<animal.length/2){ animal[i].setIsLeft(true); animal[i].setLeftImage(leftImageFile); animal[i].repaint(); animal[i].setLocation(point[i].getX()-w/2,point[i].getY()-h); animal[i].setAtPoint(point[i]); point[i].setThisAnimal(animal[i]); point[i].setIsHaveAnimal(true); }