generated from sigonasr2/CPlusPlusProjectTemplate
Skipping around move tile selections
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
c60146b898
commit
2e1815fd44
Binary file not shown.
28
main.cpp
28
main.cpp
@ -1198,23 +1198,35 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
}break;
|
||||
case BattleState::MOVE_SELECT:{
|
||||
if (LeftPressed()) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x-1,SELECTED_MOVE_SQUARE.y})) {
|
||||
SELECTED_MOVE_SQUARE.x-=1;
|
||||
for (int i=1;i<=3;i++) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x-i,SELECTED_MOVE_SQUARE.y})) {
|
||||
SELECTED_MOVE_SQUARE.x-=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RightPressed()) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x+1,SELECTED_MOVE_SQUARE.y})) {
|
||||
SELECTED_MOVE_SQUARE.x+=1;
|
||||
for (int i=1;i<=8;i++) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x+i,SELECTED_MOVE_SQUARE.y})) {
|
||||
SELECTED_MOVE_SQUARE.x+=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (UpPressed()) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y-1})) {
|
||||
SELECTED_MOVE_SQUARE.y-=1;
|
||||
for (int i=1;i<=8;i++) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y-i})) {
|
||||
SELECTED_MOVE_SQUARE.y-=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (DownPressed()) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y+1})) {
|
||||
SELECTED_MOVE_SQUARE.y+=1;
|
||||
for (int i=1;i<=8;i++) {
|
||||
if (MOVEMENT_GRID.count({SELECTED_MOVE_SQUARE.x,SELECTED_MOVE_SQUARE.y+i})) {
|
||||
SELECTED_MOVE_SQUARE.y+=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user