Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (Unit marine : marines){
- for (Unit bunker : bunkers){
- if (bunker != null && bunker.getLoadedUnits().size() < 4 ) {
- game.drawTextMap(marine.getPosition(), "Defender");
- marine.load(bunker);
- } else {
- mAttackers.add(marine);
- game.drawTextMap(marine.getPosition(), "Attacker");
- if (mAttackers.size() ==10) {
- if (marine.isUnderAttack() && marine.canAttack()) {
- for (Unit eAttacker : game.enemy().getUnits()) {
- if (eAttacker.isAttacking()) {
- if (!marine.isAttacking() && !marine.isMoving()){
- marine.attack(eAttacker);
- }
- }
- }
- }
- Position basePosition = new Position( (game.mapWidth()- self.getStartLocation().getX())* 32, (game.mapHeight()-self.getStartLocation().getY()) * 32);
- if (marine.getDistance(basePosition) < 100){
- marine.attack(randomPosition());
- } else {
- marine.attack(basePosition);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement