Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE PinDetect mbed SparkfunAnalogJoystick mbed-rtos
Fork of ECE2036Lab2StarterCode by
Diff: main.cpp
- Revision:
- 6:9cdde66d7502
- Parent:
- 4:7da18e3c590b
- Child:
- 7:7f2393b8ba4a
--- a/main.cpp Tue Apr 26 18:27:06 2016 +0000
+++ b/main.cpp Tue Apr 26 18:54:13 2016 +0000
@@ -100,26 +100,24 @@
int i = 0;
botPaddle = Paddle(gameCenterX-(paddleLength/2), gameHighY, paddleLength, paddleWidth);
- botPaddle.setLimits(gameLowX, gameHighX);
+ botPaddle.setLimits(gameLowX, gameHighX - paddleWidth);
botPaddle.setMaxMove(2);
topPaddle = Paddle(gameCenterX-(paddleLength/2), gameLowY, paddleLength, paddleWidth);
- topPaddle.setLimits(gameLowX, gameHighX);
+ topPaddle.setLimits(gameLowX, gameHighX - paddleWidth);
topPaddle.setMaxMove(2);
ball = Ball(gameCenterX, gameCenterY, ballSize);
ball.setVxDir(true);
ball.setVyDir(true);
- while (!pc.writeable()){
+ while (!pc.readable()){
}
Thread thread1(speaker_thread);
- Thread::wait(5000);
-
while (1)
- {
+ {
switch (gameState)
{
case START:
