hedgewars/uVisualGears.pas
changeset 1776 dd5648e250e4
parent 1762 fe79315a0b66
child 1792 c30c6944bd49
equal deleted inserted replaced
1775:c7dc2f191347 1776:dd5648e250e4
    89 Gear^.Y:= Gear^.Y + (Gear^.dY + cGravity * vobFallSpeed) * Steps;
    89 Gear^.Y:= Gear^.Y + (Gear^.dY + cGravity * vobFallSpeed) * Steps;
    90 Gear^.Angle:= Gear^.Angle + Gear^.dAngle * Steps;
    90 Gear^.Angle:= Gear^.Angle + Gear^.dAngle * Steps;
    91 
    91 
    92 if hwRound(Gear^.X) < -cScreenWidth - 64 then Gear^.X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else
    92 if hwRound(Gear^.X) < -cScreenWidth - 64 then Gear^.X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else
    93 if hwRound(Gear^.X) > cScreenWidth + LAND_WIDTH then Gear^.X:= int2hwFloat(-cScreenWidth - 64);
    93 if hwRound(Gear^.X) > cScreenWidth + LAND_WIDTH then Gear^.X:= int2hwFloat(-cScreenWidth - 64);
    94 if hwRound(Gear^.Y) > (LAND_HEIGHT + 75) then Gear^.Y:= Gear^.Y - int2hwFloat(LAND_HEIGHT + 200)
    94 if hwRound(Gear^.Y) > (LAND_HEIGHT + 75) then Gear^.Y:= Gear^.Y - int2hwFloat(LAND_HEIGHT-1024) // TODO - configure in theme (jellies for example could use limited range)
    95 end;
    95 end;
    96 
    96 
    97 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
    97 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
    98 var i: Longword;
    98 var i: Longword;
    99 begin
    99 begin
   100 Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps;
   100 Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps;
   101 
   101 
   102 for i:= 0 to Steps - 1 do
   102 for i:= 0 to Steps - 1 do
   103 	begin
   103 	begin
   104 	if hwRound(Gear^.Y) > -160 then
   104 	if hwRound(Gear^.Y) > LAND_HEIGHT-1184 then // TODO - configure in theme
   105 		Gear^.dY:= Gear^.dY - _1div50000
   105 		Gear^.dY:= Gear^.dY - _1div50000
   106 	else
   106 	else
   107 		Gear^.dY:= Gear^.dY + _1div50000;
   107 		Gear^.dY:= Gear^.dY + _1div50000;
   108 
   108 
   109 	Gear^.Y:= Gear^.Y + Gear^.dY
   109 	Gear^.Y:= Gear^.Y + Gear^.dY
   296 
   296 
   297 procedure AddClouds;
   297 procedure AddClouds;
   298 var i: LongInt;
   298 var i: LongInt;
   299 begin
   299 begin
   300 for i:= 0 to cCloudsNumber - 1 do
   300 for i:= 0 to cCloudsNumber - 1 do
   301     AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div (cCloudsNumber + 1)), -160, vgtCloud)
   301     AddVisualGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div (cCloudsNumber + 1)), LAND_HEIGHT-1184, vgtCloud)
   302 end;
   302 end;
   303 
   303 
   304 initialization
   304 initialization
   305 
   305 
   306 finalization
   306 finalization