예제 #1
0
파일: SFX.cs 프로젝트: hochladen/Hacknet
 public static void Update(float t)
 {
     for (int index1 = 0; index1 < SFX.circlePos.Count; ++index1)
     {
         List <float> circleExpand;
         int          index2;
         (circleExpand = SFX.circleExpand)[index2 = index1] = circleExpand[index2] + t;
         if ((double)SFX.circleExpand[index1] >= 3.0)
         {
             SFX.circlePos.RemoveAt(index1);
             SFX.circleColor.RemoveAt(index1);
             SFX.circleExpand.RemoveAt(index1);
             SFX.circleRadius.RemoveAt(index1);
             --index1;
         }
     }
     for (int index = 0; index < SFX.RadialLines.Count; ++index)
     {
         SFX.RadialLineData radialLine = SFX.RadialLines[index];
         radialLine.distance          -= radialLine.MovementPerSecond * t;
         radialLine.MovementPerSecond += radialLine.Acceleration * t;
         if ((double)radialLine.distance <= 0.0)
         {
             SFX.RadialLines.RemoveAt(index);
             --index;
         }
         else
         {
             SFX.RadialLines[index] = radialLine;
         }
     }
 }
예제 #2
0
파일: SFX.cs 프로젝트: hochladen/Hacknet
 public static void Draw(SpriteBatch sb)
 {
     try
     {
         for (int index = 0; index < SFX.circlePos.Count; ++index)
         {
             float num1 = SFX.circleExpand[index] / 3f;
             float num2 = (double)num1 >= 0.200000002980232 ? 1f - num1 : num1 / 0.2f;
             sb.Draw(SFX.circleTex, SFX.circlePos[index], new Rectangle?(), SFX.circleColor[index] * num2, 0.0f, SFX.circleOrigin, Vector2.One * SFX.circleRadius[index] * SFX.circleExpand[index], SpriteEffects.None, 0.2f);
         }
         for (int index = 0; index < SFX.RadialLines.Count; ++index)
         {
             SFX.RadialLineData radialLine = SFX.RadialLines[index];
             float   val1      = radialLine.MovementPerSecond * radialLine.SizeForSpeedMultiplier;
             Vector2 cartesian = Utils.PolarToCartesian(radialLine.angle, radialLine.distance);
             float   magnitude;
             if (radialLine.SnapMode)
             {
                 magnitude = Math.Min(val1, cartesian.Length());
             }
             else
             {
                 magnitude = Math.Min(val1, radialLine.distance);
                 if ((double)magnitude < 0.0)
                 {
                     magnitude = 0.0f;
                 }
             }
             Vector2 vector2 = cartesian + Utils.PolarToCartesian(radialLine.angle, magnitude);
             float   num     = 1f;
             if ((double)radialLine.distance > (double)radialLine.FadeDistance)
             {
                 num = (float)(1.0 - ((double)radialLine.distance - (double)radialLine.FadeDistance) / (double)radialLine.FadeDistance);
             }
             Utils.drawLineAlt(sb, radialLine.destination + cartesian, radialLine.destination + vector2, Vector2.Zero, radialLine.color * num, 0.5f, radialLine.width, Utils.gradientLeftRight);
         }
     }
     catch (IndexOutOfRangeException ex)
     {
     }
     catch (ArgumentOutOfRangeException ex)
     {
     }
 }