Jiysea

Untitled

May 28th, 2022 (edited)
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 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.                 float radian = MathHelper.DegreesToRadians(angle);
  8.                 var p = GetLayer("Foreground").CreateSprite(spritePath);
  9.                 p.Fade(startTime, fadeOpac);
  10.                 p.ScaleVec(startTime, scale);
  11.  
  12.                 // float prevExplode = 1;
  13.                 for (double time = startTime; time < endTime; time += 150)
  14.                 {
  15.                     // float curExplode = prevExplode * 1.5f;
  16.                     float secRadian = MathHelper.DegreesToRadians(angle + moving);
  17.                     float movRadian = secRadian + MathHelper.DegreesToRadians(6);
  18.  
  19.                     p.Move(time, time + 150, x + Math.Cos(secRadian) * (distance), y + Math.Sin(secRadian) * (distance),
  20.                                                        x + Math.Cos(movRadian) * (distance), y + Math.Sin(movRadian) * (distance));
  21.  
  22.                     // prevExplode = curExplode;
  23.                     moving += 6;
  24.                 }
  25.  
  26.                 p.Fade(endTime, 0);
  27.                 angle += 6;
  28.             }
  29.         }
Add Comment
Please, Sign In to add comment