hedgewars/VGSHandlers.inc
changeset 5151 cbadb9fa52fc
parent 5121 2d34ec60992c
child 5179 8d64dcb566ea
equal deleted inserted replaced
5150:63ad8a648afd 5151:cbadb9fa52fc
   104 begin
   104 begin
   105 Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX) * Steps;
   105 Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX) * Steps;
   106 
   106 
   107 // up-and-down-bounce magic
   107 // up-and-down-bounce magic
   108 s := (GameTicks + Gear^.Timer) mod 4096;
   108 s := (GameTicks + Gear^.Timer) mod 4096;
   109 t := 8 * AngleSin(s mod 2048).QWordValue / 4294967296;
   109 t := 8 * hwFloat2Float(AngleSin(s mod 2048));
   110 if (s < 2048) then t := -t;
   110 if (s < 2048) then t := -t;
   111 
   111 
   112 Gear^.Y := LAND_HEIGHT - 1184 + LongInt(Gear^.Timer mod 8) + t;
   112 Gear^.Y := LAND_HEIGHT - 1184 + LongInt(Gear^.Timer mod 8) + t;
   113 
   113 
   114 if round(Gear^.X) < cLeftScreenBorder then Gear^.X:= Gear^.X + cScreenSpace else
   114 if round(Gear^.X) < cLeftScreenBorder then Gear^.X:= Gear^.X + cScreenSpace else
   463 begin
   463 begin
   464 if Gear^.Timer > Steps then dec(Gear^.Timer, Steps) else Gear^.Timer:= 0;
   464 if Gear^.Timer > Steps then dec(Gear^.Timer, Steps) else Gear^.Timer:= 0;
   465 
   465 
   466 if (Gear^.Hedgehog^.Gear <> nil) then
   466 if (Gear^.Hedgehog^.Gear <> nil) then
   467     begin
   467     begin
   468     Gear^.X:= Gear^.Hedgehog^.Gear^.X.QWordValue/4294967296 + (Gear^.Tex^.w div 2  - Gear^.FrameTicks);
   468     Gear^.X:= hwFloat2Float(Gear^.Hedgehog^.Gear^.X) + (Gear^.Tex^.w div 2  - Gear^.FrameTicks);
   469     Gear^.Y:= Gear^.Hedgehog^.Gear^.Y.QWordValue/4294967296 - (16 + Gear^.Tex^.h);
   469     Gear^.Y:= hwFloat2Float(Gear^.Hedgehog^.Gear^.Y) - (16 + Gear^.Tex^.h);
   470     end;
   470     end;
   471 
   471 
   472 if Gear^.Timer = 0 then
   472 if Gear^.Timer = 0 then
   473     begin
   473     begin
   474     if Gear^.Hedgehog^.SpeechGear = Gear then
   474     if Gear^.Hedgehog^.SpeechGear = Gear then