hedgewars/HHHandlers.inc
changeset 6117 2a4829172a29
parent 6116 93e04cddd08e
child 6118 7684ca4f9808
equal deleted inserted replaced
6116:93e04cddd08e 6117:2a4829172a29
  1093 AllInactive:= false
  1093 AllInactive:= false
  1094 end;
  1094 end;
  1095 
  1095 
  1096 ////////////////////////////////////////////////////////////////////////////////
  1096 ////////////////////////////////////////////////////////////////////////////////
  1097 procedure doStepHedgehog(Gear: PGear);
  1097 procedure doStepHedgehog(Gear: PGear);
       
  1098 (*
       
  1099 var x,y,tx,ty: LongInt;
       
  1100     tdX, tdY, slope: hwFloat; *)
  1098 begin
  1101 begin
  1099 if (Gear^.Message and gmDestroy) <> 0 then
  1102 if (Gear^.Message and gmDestroy) <> 0 then
  1100     begin
  1103     begin
  1101     DeleteGear(Gear);
  1104     DeleteGear(Gear);
  1102     exit
  1105     exit
  1110         if Team^.hasGone then
  1113         if Team^.hasGone then
  1111             TeamGoneEffect(Team^)
  1114             TeamGoneEffect(Team^)
  1112         else
  1115         else
  1113             doStepHedgehogDriven(Gear)
  1116             doStepHedgehogDriven(Gear)
  1114     end;
  1117     end;
  1115 end;
  1118 
       
  1119 if ((GameTicks mod 100) = 0) and (Gear^.State and (gstMoving or gstHHJumping or gstHHHJump) = 0) and ((Gear^.Message and gmAllStoppable) = 0) and 
       
  1120     (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
       
  1121     begin
       
  1122     if CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y)+cHHRadius, lfIce) then
       
  1123         begin
       
  1124         Gear^.dX.QWordValue:= Gear^.dX.QWordValue + cGravity.QWordValue * 150;
       
  1125         Gear^.State:= Gear^.State or gstMoving;
       
  1126         end
       
  1127 (*
       
  1128     // check land slope, and impart a dX based on it
       
  1129     tdX:= Gear^.dX;
       
  1130     tdY:= Gear^.dY;
       
  1131     Gear^.dX:= _0;
       
  1132     Gear^.dY:= _1;
       
  1133     x := hwRound(Gear^.X);
       
  1134     y := hwRound(Gear^.Y);
       
  1135     tx := 0;
       
  1136     ty := 0;
       
  1137     if not CalcSlopeTangent(Gear, x, y+cHHRadius, tx, ty, 255) then
       
  1138         begin
       
  1139         slope:= _1/DistanceI(tx,ty);
       
  1140         AddFileLog(FloatToStr(tdX)+ ' == '+FloatToStr(slope));
       
  1141         tdX:= tdX + (cGravity * slope / _10)  // this will need tuning 
       
  1142         end;
       
  1143     Gear^.dX:= tdX;
       
  1144     Gear^.dY:= tdY  *)
       
  1145     end;
       
  1146 end;