Skip to content

Commit

Permalink
examplefuncsplayer improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
TheApplePieGod committed Jan 6, 2025
1 parent f293c46 commit 981e5a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example-bots/src/main/examplefuncsplayer/RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ public static void runSoldier(RobotController rc) throws GameActionException{
rc.move(dir);
}
// Try to paint beneath us as we walk to avoid paint penalties.
if (rc.canAttack(rc.getLocation())){
// Avoiding wasting paint by re-painting our own tiles.
MapInfo currentTile = rc.senseMapInfo(rc.getLocation());
if (!currentTile.getPaint().isAlly() && rc.canAttack(rc.getLocation())){
rc.attack(rc.getLocation());
}
}
Expand Down

0 comments on commit 981e5a2

Please sign in to comment.