/** * Sets the group of human sprites within the given x-y bounds as the human squad. * * @param x1 * @param y1 * @param x2 * @param y2 */ public void setHumanSquad(int x1, int y1, int x2, int y2) { humanSquadSelectionBox = PlayerMouseControls.updateSelectionBox(x1, y1, x2, y2); for (Sprite s : humanSquad) { s.setInSquad(false); } humanSquad = new ArrayList<Sprite>(); for (Sprite s : humanSprites) { if (s.xCurrent >= humanSquadSelectionBox[0][0] && s.xCurrent <= humanSquadSelectionBox[1][0] && s.yCurrent >= humanSquadSelectionBox[0][1] && s.yCurrent <= humanSquadSelectionBox[1][1]) { humanSquad.add(s); s.setInSquad(true); } } }