81 begin |
81 begin |
82 i:= 1; |
82 i:= 1; |
83 repeat |
83 repeat |
84 begin |
84 begin |
85 inc(i); |
85 inc(i); |
86 stuck:= TestCollisionYwithGear(HHGear, i) <> 0 |
86 stuck:= TestCollisionYwithGear(HHGear, 1) <> 0; |
|
87 if stuck then HHGear^.Y:= HHGear^.Y-_1 |
87 end |
88 end |
88 until (i = 8) or not stuck; |
89 until (i = 8) or not stuck; |
89 HHGear^.Y:= HHGear^.Y-int2hwFloat(pred(i)); |
|
90 // experiment in simulating something the shoppa players apparently expect |
90 // experiment in simulating something the shoppa players apparently expect |
91 if Gear^.Message and gmDown <> 0 then |
91 if Gear^.Message and gmDown <> 0 then |
92 HHGear^.dY:= HHGear^.dY / 8; |
92 begin |
|
93 //HHGear^.dY:= HHGear^.dY / 16; |
|
94 HHGear^.dY:= _0; |
|
95 HHGear^.dX:= HHGear^.dX * 2 |
|
96 end; |
93 if Gear^.Message and gmRight <> 0 then |
97 if Gear^.Message and gmRight <> 0 then |
94 HHGear^.dX.isNegative:= false |
98 HHGear^.dX.isNegative:= false |
95 else if Gear^.Message and gmLeft <> 0 then |
99 else if Gear^.Message and gmLeft <> 0 then |
96 HHGear^.dX.isNegative:= true |
100 HHGear^.dX.isNegative:= true |
97 end |
101 end |
98 else if (TestCollisionYwithGear(HHGear, -1) <> 0) and (TestCollisionYwithGear(HHGear, 1) = 0) then |
102 else if (TestCollisionYwithGear(HHGear, -1) <> 0) and (TestCollisionYwithGear(HHGear, 1) = 0) then |
99 begin |
103 begin |
100 i:= -1; |
104 i:= 1; |
101 repeat |
105 repeat |
102 begin |
106 begin |
103 dec(i); |
107 inc(i); |
104 stuck:= TestCollisionYwithGear(HHGear, i) <> 0 |
108 stuck:= TestCollisionYwithGear(HHGear, -1) <> 0; |
|
109 if stuck then HHGear^.Y:= HHGear^.Y+_1 |
105 end |
110 end |
106 until (i = -8) or not stuck; |
111 until (i = 8) or not stuck; |
107 HHGear^.Y:= HHGear^.Y-int2hwFloat(succ(i)); |
|
108 if Gear^.Message and gmDown <> 0 then |
112 if Gear^.Message and gmDown <> 0 then |
109 HHGear^.dY:= HHGear^.dY / 8; |
113 begin |
|
114 //HHGear^.dY:= HHGear^.dY / 16; |
|
115 HHGear^.dY.QWordValue:= 0; |
|
116 HHGear^.dX:= HHGear^.dX * 2 |
|
117 end; |
|
118 if Gear^.Message and gmRight <> 0 then |
|
119 HHGear^.dX.isNegative:= true |
|
120 else if Gear^.Message and gmLeft <> 0 then |
|
121 HHGear^.dX.isNegative:= false |
|
122 end; |
|
123 if TestCollisionXwithGear(HHGear, 1) and not TestCollisionXwithGear(HHGear, -1) then |
|
124 begin |
|
125 i:= 1; |
|
126 repeat |
|
127 begin |
|
128 inc(i); |
|
129 stuck:= TestCollisionXwithGear(HHGear, 1); |
|
130 if stuck then HHGear^.X:= HHGear^.X-_1 |
|
131 end |
|
132 until (i = 8) or not stuck; |
|
133 if Gear^.Message and gmDown <> 0 then |
|
134 begin |
|
135 //HHGear^.dX:= HHGear^.dX / 16; |
|
136 HHGear^.dX.QWordValue:= 0; |
|
137 HHGear^.dY:= HHGear^.dY * 2 |
|
138 end; |
|
139 if Gear^.Message and gmRight <> 0 then |
|
140 HHGear^.dX.isNegative:= true |
|
141 else if Gear^.Message and gmLeft <> 0 then |
|
142 HHGear^.dX.isNegative:= false |
|
143 end |
|
144 else if TestCollisionXwithGear(HHGear, -1) and not TestCollisionXwithGear(HHGear, 1) then |
|
145 begin |
|
146 i:= 1; |
|
147 repeat |
|
148 begin |
|
149 inc(i); |
|
150 stuck:= TestCollisionXwithGear(HHGear, -1); |
|
151 if stuck then HHGear^.X:= HHGear^.X+_1 |
|
152 end |
|
153 until (i = 8) or not stuck; |
|
154 if Gear^.Message and gmDown <> 0 then |
|
155 begin |
|
156 //HHGear^.dX:= HHGear^.dX / 16; |
|
157 HHGear^.dX.QWordValue:= 0; |
|
158 HHGear^.dY:= HHGear^.dY * 2 |
|
159 end; |
110 if Gear^.Message and gmRight <> 0 then |
160 if Gear^.Message and gmRight <> 0 then |
111 HHGear^.dX.isNegative:= false |
161 HHGear^.dX.isNegative:= false |
112 else if Gear^.Message and gmLeft <> 0 then |
162 else if Gear^.Message and gmLeft <> 0 then |
113 HHGear^.dX.isNegative:= true |
163 HHGear^.dX.isNegative:= true |
114 end; |
|
115 if TestCollisionXwithGear(HHGear, 1) and not TestCollisionXwithGear(HHGear, -1) then |
|
116 begin |
|
117 i:= 1; |
|
118 repeat |
|
119 begin |
|
120 inc(i); |
|
121 stuck:= TestCollisionXwithGear(HHGear, i) |
|
122 end |
|
123 until (i = 8) or not stuck; |
|
124 HHGear^.X:= HHGear^.X-int2hwFloat(pred(i)); |
|
125 if Gear^.Message and gmDown <> 0 then |
|
126 HHGear^.dX.QWordValue:= 0 |
|
127 end |
|
128 else if TestCollisionXwithGear(HHGear, -1) and not TestCollisionXwithGear(HHGear, 1) then |
|
129 begin |
|
130 i:= -1; |
|
131 repeat |
|
132 begin |
|
133 dec(i); |
|
134 stuck:= TestCollisionXwithGear(HHGear, i) |
|
135 end |
|
136 until (i = -8) or not stuck; |
|
137 HHGear^.X:= HHGear^.X-int2hwFloat(succ(i)); |
|
138 if Gear^.Message and gmDown <> 0 then |
|
139 HHGear^.dX.QWordValue:= 0 |
|
140 end |
164 end |
141 end; |
165 end; |
142 |
166 |
143 procedure RopeDeleteMe(Gear, HHGear: PGear); |
167 procedure RopeDeleteMe(Gear, HHGear: PGear); |
144 begin |
168 begin |