1674 xx:= dirs[Gear^.Angle].x; |
1674 xx:= dirs[Gear^.Angle].x; |
1675 yy:= dirs[Gear^.Angle].y; |
1675 yy:= dirs[Gear^.Angle].y; |
1676 xxn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x; |
1676 xxn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x; |
1677 yyn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y; |
1677 yyn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y; |
1678 |
1678 |
1679 |
|
1680 if (xx = 0) then |
1679 if (xx = 0) then |
1681 if TestCollisionYwithGear(Gear, yy) then |
1680 if TestCollisionYwithGear(Gear, yy) then |
1682 PrevAngle |
1681 PrevAngle |
1683 else begin |
1682 else begin |
1684 Gear^.Tag:= 0; |
1683 Gear^.Tag:= 0; |
1685 Gear^.Y:= Gear^.Y + int2hwFloat(yy); |
1684 Gear^.Y:= Gear^.Y + int2hwFloat(yy); |
1686 if not TestCollisionXwithGear(Gear, xxn) then NextAngle |
1685 if not TestCollisionXwithGear(Gear, xxn) then |
|
1686 begin |
|
1687 Gear^.X:= Gear^.X + int2hwFloat(xxn); |
|
1688 NextAngle |
|
1689 end; |
1687 end; |
1690 end; |
1688 |
1691 |
1689 if (yy = 0) then |
1692 if (yy = 0) then |
1690 if TestCollisionXwithGear(Gear, xx) then |
1693 if TestCollisionXwithGear(Gear, xx) then |
1691 PrevAngle |
1694 PrevAngle |
1692 else begin |
1695 else begin |
1693 Gear^.Tag:= 0; |
1696 Gear^.Tag:= 0; |
1694 Gear^.X:= Gear^.X + int2hwFloat(xx); |
1697 Gear^.X:= Gear^.X + int2hwFloat(xx); |
1695 if not TestCollisionYwithGear(Gear, yyn) then NextAngle |
1698 if not TestCollisionYwithGear(Gear, yyn) then |
|
1699 begin |
|
1700 Gear^.Y:= Gear^.Y + int2hwFloat(yyn); |
|
1701 NextAngle |
|
1702 end; |
1696 end; |
1703 end; |
1697 |
1704 |
1698 if Gear^.Tag = 0 then |
1705 if Gear^.Tag = 0 then |
1699 begin |
1706 begin |
1700 CakeI:= (CakeI + 1) mod cakeh; |
1707 CakeI:= (CakeI + 1) mod cakeh; |