equal
deleted
inserted
replaced
87 end; |
87 end; |
88 |
88 |
89 |
89 |
90 // ================================================================== |
90 // ================================================================== |
91 procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
91 procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
92 begin |
92 var sign: hwFloat; |
|
93 begin |
|
94 sign:= _1; |
93 with Gear^ do |
95 with Gear^ do |
94 begin |
96 begin |
95 inc(FrameTicks, Steps); |
97 inc(FrameTicks, Steps); |
96 if FrameTicks > vobFrameTicks then |
98 if FrameTicks > vobFrameTicks then |
97 begin |
99 begin |
106 if (hwRound(X) >= -cScreenWidth - 64) and |
108 if (hwRound(X) >= -cScreenWidth - 64) and |
107 (hwRound(X) <= cScreenWidth + LAND_WIDTH) and |
109 (hwRound(X) <= cScreenWidth + LAND_WIDTH) and |
108 (hwRound(Y) <= (LAND_HEIGHT + 75)) and |
110 (hwRound(Y) <= (LAND_HEIGHT + 75)) and |
109 (Timer > 0) and (Timer-Steps > 0) then |
111 (Timer > 0) and (Timer-Steps > 0) then |
110 begin |
112 begin |
111 tdX:= tdX - _0_005*Steps; |
113 sign.isNegative:=tdX.isNegative; |
112 tdY:= tdY - _0_005*Steps; |
114 tdX:= tdX - _0_005*Steps*sign; |
113 if tdX < _0 then tdX:= _0; |
115 if (sign.isNegative and (tdX > _0)) or (not sign.isNegative and (tdX < _0)) then tdX:= _0; |
114 if tdY < _0 then tdY:= _0; |
116 sign.isNegative:=tdY.isNegative; |
|
117 tdY:= tdY - _0_005*Steps*sign; |
|
118 if (sign.isNegative and (tdY > _0)) or (not sign.isNegative and (tdY < _0)) then tdY:= _0; |
115 dec(Timer, Steps) |
119 dec(Timer, Steps) |
116 end |
120 end |
117 else |
121 else |
118 begin |
122 begin |
119 if hwRound(X) < -cScreenWidth - 64 then X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else |
123 if hwRound(X) < -cScreenWidth - 64 then X:= int2hwFloat(cScreenWidth + LAND_WIDTH) else |
667 begin |
671 begin |
668 Gear:= t; |
672 Gear:= t; |
669 if Gear^.Kind = vgtFlake then |
673 if Gear^.Kind = vgtFlake then |
670 begin |
674 begin |
671 // Damage calc from doMakeExplosion |
675 // Damage calc from doMakeExplosion |
672 dmg:= min(100,Radius*2 + cHHRadius div 2 - hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)))); |
676 dmg:= min(100,Radius + cHHRadius div 2 - (hwRound(hwAbs(Gear^.X - int2hwFloat(X))+hwAbs(Gear^.Y - int2hwFloat(Y))) div 5)); |
673 if dmg > 1 then |
677 if dmg > 1 then |
674 begin |
678 begin |
675 Gear^.tdX:= Gear^.dX + SignAs(_0_01 * dmg + cHHKick, Gear^.X - int2hwFloat(X)); |
679 Gear^.tdX:= SignAs(_0_02 * dmg + cHHKick, Gear^.X - int2hwFloat(X)); |
676 Gear^.tdY:= Gear^.dY + SignAs(_0_01 * dmg + cHHKick, Gear^.Y - int2hwFloat(Y)); |
680 Gear^.tdY:= SignAs(_0_02 * dmg + cHHKick, Gear^.Y - int2hwFloat(Y)); |
677 Gear^.Timer:= 200 |
681 Gear^.Timer:= 200 |
678 end |
682 end |
679 end; |
683 end; |
680 t:= Gear^.NextGear |
684 t:= Gear^.NextGear |
681 end |
685 end |