示例#1
0
  Vec2 AttackMode() {
    abstract_robot.setDisplayString("Attack");
    Vec2 TargetSpot = new Vec2(CurBallPosEgo.x, CurBallPosEgo.y);
    Vec2 GoalSpot = new Vec2(CurOpponentsGoal.x, CurOpponentsGoal.y);
    if (CurMyPos.y > 0) GoalSpot.y += 0.9 * (GOAL_WIDTH / 2.0);
    if (CurMyPos.y < 0) GoalSpot.y -= 0.9 * (GOAL_WIDTH / 2.0);
    TargetSpot.sub(GoalSpot);
    TargetSpot.setr(ROBOT_RADIUS);
    TargetSpot.add(CurBallPosEgo);

    if (Math.abs(CurOpponentsGoal.r) < KICK_DISTANCE) KickIt = true;
    else KickIt = false;

    return (TargetSpot);
  }