File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -159,18 +159,10 @@ void updatePaddlePositions()
159
159
if (BUTTON_UP.pinRead () == LOW)
160
160
{
161
161
player1PosY--;
162
- if (player1PosY - halfPaddleHeight < 0 )
163
- {
164
- player1PosY = halfPaddleHeight;
165
- }
166
162
}
167
163
if (BUTTON_DOWN.pinRead () == LOW)
168
164
{
169
165
player1PosY++;
170
- if (player1PosY - halfPaddleHeight > LCDHEIGHT)
171
- {
172
- player1PosY = LCDHEIGHT - halfPaddleHeight;
173
- }
174
166
}
175
167
player1PosY = constrainPosition (player1PosY);
176
168
@@ -193,18 +185,10 @@ void updatePaddlePositions()
193
185
if (BUTTON_A.pinRead () == LOW)
194
186
{
195
187
player2PosY--;
196
- if (player2PosY - halfPaddleHeight < 0 )
197
- {
198
- player2PosY = halfPaddleHeight;
199
- }
200
188
}
201
189
if (BUTTON_B.pinRead () == LOW)
202
190
{
203
191
player2PosY++;
204
- if (player2PosY - halfPaddleHeight > LCDHEIGHT)
205
- {
206
- player2PosY = LCDHEIGHT - halfPaddleHeight;
207
- }
208
192
}
209
193
}
210
194
player2PosY = constrainPosition (player2PosY);
You can’t perform that action at this time.
0 commit comments