Skipping around move tile selections

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent c60146b898
commit 2e1815fd44
  1. BIN
      C++ProjectTemplate
  2. 28
      main.cpp

Binary file not shown.

@ -1198,23 +1198,35 @@ goes on a very long time, I hope you can understand this is only for testing pur
}break; }break;
case BattleState::MOVE_SELECT:{ case BattleState::MOVE_SELECT:{
if (LeftPressed()) { if (LeftPressed()) {
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x-1,SELECTED_MOVE_SQUARE.y})) { for (int i=1;i<=3;i++) {
SELECTED_MOVE_SQUARE.x-=1; if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x-i,SELECTED_MOVE_SQUARE.y})) {
SELECTED_MOVE_SQUARE.x-=i;
break;
}
} }
} }
if (RightPressed()) { if (RightPressed()) {
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x+1,SELECTED_MOVE_SQUARE.y})) { for (int i=1;i<=8;i++) {
SELECTED_MOVE_SQUARE.x+=1; if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x+i,SELECTED_MOVE_SQUARE.y})) {
SELECTED_MOVE_SQUARE.x+=i;
break;
}
} }
} }
if (UpPressed()) { if (UpPressed()) {
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y-1})) { for (int i=1;i<=8;i++) {
SELECTED_MOVE_SQUARE.y-=1; if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y-i})) {
SELECTED_MOVE_SQUARE.y-=i;
break;
}
} }
} }
if (DownPressed()) { if (DownPressed()) {
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y+1})) { for (int i=1;i<=8;i++) {
SELECTED_MOVE_SQUARE.y+=1; if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y+i})) {
SELECTED_MOVE_SQUARE.y+=i;
break;
}
} }
} }
}break; }break;

Loading…
Cancel
Save