Slightly different easing equations for bigexplosion
authorpalewolf
Fri, 02 Apr 2010 20:49:23 +0000
changeset 3267 02139461250c
parent 3266 aef4b9316060
child 3268 0e52ca22c1e0
Slightly different easing equations for bigexplosion
hedgewars/uGears.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uGears.pas	Fri Apr 02 20:32:37 2010 +0000
+++ b/hedgewars/uGears.pas	Fri Apr 02 20:49:23 2010 +0000
@@ -1747,8 +1747,8 @@
                         DrawTextureF(SpritesData[sprBirdy].Texture, 1, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
                     end;
     gtBigExplosion: begin
-                    glColor4f(1, 1, 1, 1.0 * (power(2, -5 * (Gear^.Timer-200)/200)));
-                    DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -4 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
+                    glColor4f(1, 1, 1, -1.0 * (power(Gear^.Timer/250, 4) - 1));
+                    DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
                     glColor4f(1, 1, 1, 1);
                     end;
              gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 16, 16, Gear^.DirAngle);
--- a/hedgewars/uVisualGears.pas	Fri Apr 02 20:32:37 2010 +0000
+++ b/hedgewars/uVisualGears.pas	Fri Apr 02 20:49:23 2010 +0000
@@ -334,8 +334,8 @@
 if Gear^.Timer >= Gear^.FrameTicks then DeleteVisualGear(Gear)
 else
     begin
-    Gear^.scale := 1.25 * (-power(2, -7 * Int(Gear^.Timer)/Gear^.FrameTicks) + 1) + 0.4;
-    Gear^.alpha := 1.0 * (power(2, -3 * (Gear^.Timer - 350)/350));
+    Gear^.scale := 1.25 * (-power(2, -10 * Int(Gear^.Timer)/Gear^.FrameTicks) + 1) + 0.4;
+    Gear^.alpha := -1.0 * (power(Gear^.Timer/350, 4) - 1);
     end;
 end;