@Override
    public int takeStep() 
    {
    	fillVariables();
    	
    	if (myRobotAPI.blocked() && !secondGoalkeeper) {
    		this.goToGloDestination(this.gloMyPosition, this.gloOurFirstGoalPost, 0);
    		if (this.nearGloPosition(this.gloMyPosition, this.gloOurFirstGoalPost, 0)) {
    			myRobotAPI.setSpeed(0);
    		}
			MessageEvent message = new MessageEvent();
			message.setReceiver(0);
			message.setType(Type.trainer);
			message.setEventText("Portero bloqueado");
			myRobotAPI.getTeamManager().sendMessage(message);
			
			myRobotAPI.avoidCollisions();
    	} else {
    		if (!myRobotAPI.blocked() && !secondGoalkeeper) {
				MessageEvent message = new MessageEvent();
				message.setReceiver(0);
				message.setType(Type.trainer);
				message.setEventText("Portero libre");
				myRobotAPI.getTeamManager().sendMessage(message);
    		}

			if (gloBallBehindLine(this.gloBall, -0.3, this.ourField)) {
				myRobotAPI.setBehindBall(this.egoOppGoal);
				myRobotAPI.passBall(new Vec2(0, 0.6));
				if (myRobotAPI.canKick()) {
					myRobotAPI.kick();
				}
			} else {
				goToGloDestination(this.gloMyPosition, new Vec2(this.gloOurGoal.x - 0.1 * this.ourField, this.gloOurGoal.y), 0.1);
			}
    	}
    	return RobotAPI.ROBOT_OK;
    }