Esempio n. 1
0
 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());
   }
 }
Esempio n. 2
0
 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());
     }
   }
 }
Esempio n. 3
0
 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);
     }
   }
 }