public IEnumerator<float> TitleScreenAnimation() { Vector2 screenCenter = new Vector2((ScreenArea.Width - 48) / 2, (ScreenArea.Height - 48) / 2); TitleScreenAnimation newCrystal; float angle = 3.4f; float distance = 230f; titleTime = 0; while(backgroundColor != new Color(.6f, .6f, .6f, 1f)) { backgroundColor = Color.Lerp(Color.Black, new Color(.6f, .6f, .6f, 1f), titleTime / 3f); yield return 0f; } for (int i = 0; i < 10; i++) { yield return .4f; float newX = (float)Math.Cos(angle) * distance; float newY = (float)Math.Sin(angle) * distance; newCrystal = new TitleScreenAnimation(crystalTexture, 48, 48, new int[] { 0, 1, 2, 3 }, 6, true); newCrystal.Position = new Vector2(screenCenter.X + newX, screenCenter.Y + newY); newCrystal.ChangeColor(SequenceColors[i], 3f); crystals.Add(newCrystal); angle += (float)(Math.PI * 2) / 10; } titleAnimationCompleted = true; }
public void ShowTitleScreen() { backgroundColor = new Color(.6f, .6f, .6f, 1f); titleColor = new Color(.5f, .5f, .5f, 1f); crystals.Clear(); Vector2 screenCenter = new Vector2((ScreenArea.Width - 48) / 2, (ScreenArea.Height - 48) / 2); TitleScreenAnimation newCrystal; float angle = 3.4f; float distance = 230f; for (int i = 0; i < 10; i++) { float newX = (float)Math.Cos(angle) * distance; float newY = (float)Math.Sin(angle) * distance; newCrystal = new TitleScreenAnimation(crystalTexture, 48, 48, new int[] { 0, 1, 2, 3 }, 6, true); newCrystal.Position = new Vector2(screenCenter.X + newX, screenCenter.Y + newY); newCrystal.ChangeColor(SequenceColors[i], 0f); crystals.Add(newCrystal); angle += (float)(Math.PI * 2) / 10; } }