private void attackMoveSelected(int x, int y) { attackMoveClicked = false; GameSprite target = level.getSpriteAt(x, y); for (GameSprite sprite : selected) { if (target == null) sprite.goTo(x, y, true, shiftDown()); else sprite.goTo(target, true, shiftDown()); } }
private void rightMouseClick(int x, int y) { attackMoveClicked = false; GameSprite target = level.getSpriteAt(x, y); for (GameSprite sprite : selected) { if (sprite.onTeam(playerTeam)) { if (target == null) sprite.goTo(x, y, false, shiftDown()); else sprite.goTo(target, false, shiftDown()); } } }
private void leftMouseClick(int x, int y) { if (attackMoveClicked) { attackMoveSelected(x, y); } else { GameSprite sprite = level.getSpriteAt(x, y); if (sprite != null) { selected.clear(); selected.add(sprite); } } }