Skip to content

Commit 42856b2

Browse files
author
Toni Klopfenstein
committed
Merge branch 'hansmosh-cleanup'
2 parents 6d8696d + 1d2abb3 commit 42856b2

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Firmware/pong/oled_pong.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,10 @@ void updatePaddlePositions()
159159
if (BUTTON_UP.pinRead() == LOW)
160160
{
161161
player1PosY--;
162-
if (player1PosY - halfPaddleHeight < 0)
163-
{
164-
player1PosY = halfPaddleHeight;
165-
}
166162
}
167163
if (BUTTON_DOWN.pinRead() == LOW)
168164
{
169165
player1PosY++;
170-
if (player1PosY - halfPaddleHeight > LCDHEIGHT)
171-
{
172-
player1PosY = LCDHEIGHT - halfPaddleHeight;
173-
}
174166
}
175167
player1PosY = constrainPosition(player1PosY);
176168

@@ -193,18 +185,10 @@ void updatePaddlePositions()
193185
if (BUTTON_A.pinRead() == LOW)
194186
{
195187
player2PosY--;
196-
if (player2PosY - halfPaddleHeight < 0)
197-
{
198-
player2PosY = halfPaddleHeight;
199-
}
200188
}
201189
if (BUTTON_B.pinRead() == LOW)
202190
{
203191
player2PosY++;
204-
if (player2PosY - halfPaddleHeight > LCDHEIGHT)
205-
{
206-
player2PosY = LCDHEIGHT - halfPaddleHeight;
207-
}
208192
}
209193
}
210194
player2PosY = constrainPosition(player2PosY);

0 commit comments

Comments
 (0)