740 |
740 |
741 HedgehogChAngle(HHGear); |
741 HedgehogChAngle(HHGear); |
742 |
742 |
743 if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
743 if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
744 begin |
744 begin |
745 {$IFDEF DEBUGFILE}if HHGear^.dX.QWordValue > 1 then AddFileLog('Stopping hedgehog after rope attack due to wall collision');{$ENDIF} |
745 {$IFDEF DEBUGFILE}if HHGear^.dX.QWordValue > 1 then AddFileLog('1 Stopping hedgehog after rope attack due to wall collision');{$ENDIF} |
746 SetLittle(HHGear^.dX); |
746 SetLittle(HHGear^.dX); |
747 end; |
747 end; |
748 |
748 |
749 if HHGear^.dY.isNegative and TestCollisionYwithGear(HHGear, -1) then HHGear^.dY:= _0; |
749 if HHGear^.dY.isNegative and TestCollisionYwithGear(HHGear, -1) then HHGear^.dY:= _0; |
750 HHGear^.X:= HHGear^.X + HHGear^.dX; |
750 HHGear^.X:= HHGear^.X + HHGear^.dX; |
954 Gear^.Elasticity:= Gear^.Elasticity + _1; |
954 Gear^.Elasticity:= Gear^.Elasticity + _1; |
955 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
955 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
956 DeleteCI(HHGear); |
956 DeleteCI(HHGear); |
957 if (HHGear^.State and gstMoving) <> 0 then |
957 if (HHGear^.State and gstMoving) <> 0 then |
958 begin |
958 begin |
|
959 if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX); |
959 HHGear^.X:= HHGear^.X + HHGear^.dX; |
960 HHGear^.X:= HHGear^.X + HHGear^.dX; |
960 Gear^.X:= Gear^.X + HHGear^.dX; |
961 Gear^.X:= Gear^.X + HHGear^.dX; |
961 |
962 |
962 if TestCollisionYwithGear(HHGear, 1) then |
963 if TestCollisionYwithGear(HHGear, 1) then |
963 begin |
964 begin |
964 CheckHHDamage(HHGear); |
965 CheckHHDamage(HHGear); |
965 HHGear^.dY:= _0; |
966 HHGear^.dY:= _0; |
966 HHGear^.State:= HHGear^.State and not (gstMoving or gstHHJumping or gstHHHJump); |
967 HHGear^.State:= HHGear^.State and not (gstHHJumping or gstHHHJump); |
967 end else |
968 end else |
968 begin |
969 begin |
969 if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX); |
|
970 HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
970 HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
971 Gear^.Y:= Gear^.Y + HHGear^.dY; |
971 Gear^.Y:= Gear^.Y + HHGear^.dY; |
972 HHGear^.dY:= HHGear^.dY + cGravity; |
972 HHGear^.dY:= HHGear^.dY + cGravity; |
973 tt:= Gear^.Elasticity; |
973 tt:= Gear^.Elasticity; |
974 tx:= _0; |
974 tx:= _0; |