public static IBallControlStrategy StepBouncing_Up(ITiltController tiltController, Vector2?target = null, float highPos = 0.058f, float moveTime = 0.1f, Action action = null) { return(new BallControlStrategy((ballData, machineController, instructionCount) => { if (!ballData.BallIsMovingUp && ballData.CurrentPositionVector.z < 140f) { // if we're in here, the ball is coming downwards BallControlling.MoveToHeightWithXYTiltCorrection(machineController, tiltController, ballData, highPos, moveTime, target); return true; } return false; }, 1, true, onStrategyExecutionStart: action)); }
public static IBallControlStrategy StepBouncing_Down(ITiltController tiltController, Vector2?target = null, float lowPos = 0.05f, float moveTime = 0.1f, Action action = null) { return(new BallControlStrategy((ballData, machineController, instructionCount) => { if (ballData.BallIsMovingUp) { // if we're in here, the ball is moving upwards // so if the ball IS moving up, and the last thing we did was hitting the ball, then we should move down again BallControlling.MoveToHeightWithXYTiltCorrection(machineController, tiltController, ballData, lowPos, moveTime, target); return true; } return false; }, 1, true, onStrategyExecutionStart: action)); }