more adjustments to checkBarriers(), now also checks for other players as obstacles
This commit is contained in:
parent
2dc2bc8a88
commit
17e2bbfba9
@ -65,10 +65,10 @@ public class RumbleBot extends Bot
|
||||
|
||||
|
||||
|
||||
frontIsBlocked = view.data.charAt(frontIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X';
|
||||
backIsBlocked = view.data.charAt(backIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X';
|
||||
leftIsBlocked = view.data.charAt(leftIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X';
|
||||
rightIsBlocked = view.data.charAt(rightIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X';
|
||||
frontIsBlocked = view.data.charAt(frontIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X' || view.data.charAt(frontIndex) == '^' || view.data.charAt(frontIndex) == '<' || view.data.charAt(frontIndex) == '>' || view.data.charAt(frontIndex) == 'v';
|
||||
backIsBlocked = view.data.charAt(backIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X' || view.data.charAt(frontIndex) == '^' || view.data.charAt(frontIndex) == '<' || view.data.charAt(frontIndex) == '>' || view.data.charAt(frontIndex) == 'v';
|
||||
leftIsBlocked = view.data.charAt(leftIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X' || view.data.charAt(frontIndex) == '^' || view.data.charAt(frontIndex) == '<' || view.data.charAt(frontIndex) == '>' || view.data.charAt(frontIndex) == 'v';
|
||||
rightIsBlocked = view.data.charAt(rightIndex) == '~' || view.data.charAt(frontIndex) == '#' || view.data.charAt(frontIndex) == 'X' || view.data.charAt(frontIndex) == '^' || view.data.charAt(frontIndex) == '<' || view.data.charAt(frontIndex) == '>' || view.data.charAt(frontIndex) == 'v';
|
||||
trapped = frontIsBlocked && backIsBlocked && leftIsBlocked && rightIsBlocked;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user