2952 ApplyAmmoChanges(HHGear^.Hedgehog^); |
2953 ApplyAmmoChanges(HHGear^.Hedgehog^); |
2953 DeleteGear(Gear); |
2954 DeleteGear(Gear); |
2954 exit |
2955 exit |
2955 end; |
2956 end; |
2956 |
2957 |
2957 HHGear^.X := HHGear^.X + cWindSpeed * 200; |
2958 deltaX:= _0; |
|
2959 deltaX:= deltaX + cWindSpeed * 200; |
2958 |
2960 |
2959 if (Gear^.Message and gmLeft) <> 0 then |
2961 if (Gear^.Message and gmLeft) <> 0 then |
2960 HHGear^.X := HHGear^.X - cMaxWindSpeed * 80 |
2962 deltaX := deltaX - cMaxWindSpeed * 80 |
2961 |
2963 |
2962 else if (Gear^.Message and gmRight) <> 0 then |
2964 else if (Gear^.Message and gmRight) <> 0 then |
2963 HHGear^.X := HHGear^.X + cMaxWindSpeed * 80; |
2965 deltaX := deltaX + cMaxWindSpeed * 80; |
2964 |
2966 |
2965 if (Gear^.Message and gmUp) <> 0 then |
2967 if (Gear^.Message and gmUp) <> 0 then |
2966 HHGear^.Y := HHGear^.Y - cGravity * 40 |
2968 HHGear^.Y := HHGear^.Y - cGravity * 40 |
2967 |
2969 |
2968 else if (Gear^.Message and gmDown) <> 0 then |
2970 else if (Gear^.Message and gmDown) <> 0 then |
2969 HHGear^.Y := HHGear^.Y + cGravity * 40; |
2971 HHGear^.Y := HHGear^.Y + cGravity * 40; |
2970 |
2972 |
|
2973 HHGear^.X := HHGear^.X + deltaX; |
2971 // don't drift into obstacles |
2974 // don't drift into obstacles |
2972 if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) <> 0 then |
2975 if TestCollisionXwithGear(HHGear, hwSign(deltaX)) <> 0 then |
2973 HHGear^.X := HHGear^.X - int2hwFloat(hwSign(HHGear^.dX)); |
2976 HHGear^.X := HHGear^.X - int2hwFloat(hwSign(deltaX)); |
2974 HHGear^.Y := HHGear^.Y + cGravity * 100; |
2977 HHGear^.Y := HHGear^.Y + cGravity * 100; |
2975 Gear^.X := HHGear^.X; |
2978 Gear^.X := HHGear^.X; |
2976 Gear^.Y := HHGear^.Y |
2979 Gear^.Y := HHGear^.Y |
2977 end; |
2980 end; |
2978 |
2981 |