Jiysea

Not Stuck Anymore

May 28th, 2022 (edited)
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 KB | None | 0 0
  1. public void TestRun(String spritePath, double startTime, double endTime, float x, float y, float distance, double fadeOpac, Vector2 scale)
  2.         {
  3.             // float moving = 0;
  4.  
  5.             for (int angle = 0; angle < 360; angle += 6)
  6.             {
  7.                 double startMove = startTime;
  8.                 float radian = MathHelper.DegreesToRadians(angle);
  9.                 var p = GetLayer("Foreground").CreateSprite(spritePath);
  10.                 p.Fade(startTime, fadeOpac);
  11.                 p.ScaleVec(startTime, scale);
  12.  
  13.                 // for (double time = startTime; time < endTime; time += 150)
  14.                 // {
  15.  
  16.                 float loopTimes = 360 / 6;
  17.                 double duration = (endTime - startTime) / loopTimes;
  18.                 for (int angle2 = 0; angle2 < 360; angle2 += 6)
  19.                 {
  20.                     float secRadian = MathHelper.DegreesToRadians(angle + angle2);
  21.                     float movRadian = secRadian + MathHelper.DegreesToRadians(6);
  22.  
  23.                     p.Move(startMove, startMove + duration - 1, x + Math.Cos(secRadian) * (distance), y + Math.Sin(secRadian) * (distance),
  24.                                                        x + Math.Cos(movRadian) * (distance), y + Math.Sin(movRadian) * (distance));
  25.  
  26.                     startMove += duration - 1;
  27.                 }
  28.  
  29.                 // }
  30.  
  31.                 p.Fade(endTime, 0);
  32.                 angle += 6;
  33.             }
  34.         }
Add Comment
Please, Sign In to add comment