private void InitBall() { CurrentMoveX = 0; // CurrentRotateDelta = 0; IndexCurrentStairBallOn = 0; BallSideMoveDirection = 0; BallState = TBallState.bsMove; Ball.SetPosAndAngle(BALL_START_X_POS, BALL_START_Y_POS, BALL_START_Z_POS, 0, 0, 0); }
private void BallCollineSpiral() { for (int i = 0; i < NUM_SPIRALS; i++) { if (Spirals[i].Visible) { float dist = (float)Math.Sqrt(Math3D.Sqr(Spirals[i].GetXPos() - Ball.GetXPos()) + Math3D.Sqr(Spirals[i].GetZPos() - Ball.GetZPos())); if (dist < (SPIRAL_RADIUS + BALL_RADIUS)) { BallState = TBallState.bsMoveToTheSide; if (Ball.GetXPos() > Spirals[i].GetXPos()) { BallSideMoveDirection = 1; } else { BallSideMoveDirection = -1; } } } } }