public void UpdatePsychadelicLevel(float sinRotMagnitude, float[] weightedRadians, float magnitude, float angle) { innerPoints = pointManager.SpawnInnerPoints(innerPoints.Count, levelCenter, weightedRadians); pointManager.RotatePoints(innerPoints, -Mathf.Sin(angle) * magnitude * sinRotMagnitude + previousRotation); outerPoints = pointManager.SpawnOuterPoints(innerPoints); playerManager.UpdatePlayerPositions(); playerManager.PlayersLookAtPoint(levelCenter); arqdutManager.UpdateArqdutPositions(innerPoints, levelCenter); DrawMesh(innerPoints.Count); }
public void StartLerpToCircle(int playerOrder) { // Assign from lists LevelManager.innerLerpFrom = pointManager.SpawnCircleLerpPoints(PlayerManager.players[playerOrder].points, LevelManager.innerPoints, _inGameManager.levelCenter, circleEdges); LevelManager.outerLerpFrom = LevelManager.innerLerpFrom.GetRange(LevelManager.innerLerpFrom.Count / 2, LevelManager.innerLerpFrom.Count / 2); LevelManager.innerLerpFrom.RemoveRange(LevelManager.innerLerpFrom.Count / 2, LevelManager.innerLerpFrom.Count / 2); Vector2 avgVector = ((PlayerManager.players[playerOrder].points.left - _inGameManager.levelCenter) + (PlayerManager.players[playerOrder].points.right - _inGameManager.levelCenter)) / 2; float rotateAmount = avgVector.y < 0 ? 360 - Mathf.Acos(avgVector.normalized.x) * Mathf.Rad2Deg : Mathf.Acos(avgVector.normalized.x) * Mathf.Rad2Deg; // Assign to lists LevelManager.innerLerpTo = pointManager.SpawnInnerPoints(circleEdges * 2, _inGameManager.levelCenter); pointManager.RotatePoints(LevelManager.innerLerpTo, rotateAmount); LevelManager.outerLerpTo = pointManager.SpawnOuterPoints(LevelManager.innerLerpTo); //meshManager.SetMaterials(); playerManager.CircleSetPlayerPoints(LevelManager.innerLerpTo, playerOrder); _gameManager.StartCountdown(_inGameManager.levelCenter); }
public void StartLerpSmaller(int playerOrder) { lerpPlayerNumber = playerOrder; LevelManager.innerLerpFrom = LevelManager.innerPoints; LevelManager.outerLerpFrom = LevelManager.outerPoints; // TODO there was error about index being out of bounds of array after ending game in circle. This method shouldn't even be called after player dies in circle float rotateAmount = 360 / (LevelManager.innerPoints.Count * 2) - rotationConstants[LevelManager.innerPoints.Count - 1] * playerOrder + _inGameManager.previousRotation; // Calculate rotation _inGameManager.previousRotation = rotateAmount; LevelManager.innerLerpTo = pointManager.SpawnInnerPoints(LevelManager.innerPoints.Count - 1, _inGameManager.levelCenter); pointManager.RotatePoints(LevelManager.innerLerpTo, rotateAmount); // Rotate inner points LevelManager.outerLerpTo = pointManager.SpawnOuterPoints(LevelManager.innerLerpTo); joiningPoints[0] = playerOrder; joiningPoints[1] = playerOrder + 1; _gameManager.StartCountdown(_inGameManager.levelCenter); }