Browse Source

added evading shots

main
Illia Soloviov 10 months ago
parent
commit
fb2fa8507c
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/RumbleBot.java

+ 4
- 2
src/RumbleBot.java View File



for (int index : leftIndexes) { for (int index : leftIndexes) {
for (char enemy : enemies) { for (char enemy : enemies) {
if (view.data.charAt(index) == enemy) return '<';
if (view.data.charAt(index) == '>') return 'v';
else if (view.data.charAt(index) == enemy) return '<';
} }
} }


for (int index : rightIndexes) { for (int index : rightIndexes) {
for (char enemy : enemies) { for (char enemy : enemies) {
if (view.data.charAt(index) == enemy) return '>';
if (view.data.charAt(index) == '<') return 'v';
else if (view.data.charAt(index) == enemy) return '>';
} }
} }



Loading…
Cancel
Save