We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f293c46 commit 981e5a2Copy full SHA for 981e5a2
example-bots/src/main/examplefuncsplayer/RobotPlayer.java
@@ -181,7 +181,9 @@ public static void runSoldier(RobotController rc) throws GameActionException{
181
rc.move(dir);
182
}
183
// Try to paint beneath us as we walk to avoid paint penalties.
184
- if (rc.canAttack(rc.getLocation())){
+ // Avoiding wasting paint by re-painting our own tiles.
185
+ MapInfo currentTile = rc.senseMapInfo(rc.getLocation());
186
+ if (!currentTile.getPaint().isAlly() && rc.canAttack(rc.getLocation())){
187
rc.attack(rc.getLocation());
188
189
0 commit comments