public override void InGameUpdate() { base.Update(); radius += speed; //generate lightnings Random r = new Random(); float a = 0; Vector2 pos, del; Lightning l; for (int i = 0; i < 5; i++) { a = (float)(r.Next(360) * Math.PI / 180); pos = new Vector2((float)Math.Cos(a), (float)Math.Sin(a)) * (radius + thickness) + Position; del = new Vector2(r.Next(40, 50) * r.Next(2) == 0 ? 1 : -1, r.Next(40, 50) * r.Next(2) == 0 ? 1 : -1) * 8; l = new Lightning(pos, pos + del, 2, 10, 4); ParticleManager.Add(l); particles[i + startInd] = l; } startInd += 5; if (startInd >= particles.Length) startInd = 0; }