SharpShooter

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player

Revision:
15:e09ab0d14d4b
Parent:
12:2f358065ba3f
--- a/Obstacle.h	Sat Oct 29 20:02:57 2016 +0000
+++ b/Obstacle.h	Mon Oct 31 18:15:21 2016 +0000
@@ -54,9 +54,8 @@
 void Obstacle::move(int speed) {
     mutex.lock();
     Obstacle::eraseObstacle();
-    if (x1<=1 || x2>=127) {
+    if ((x1<=1 && direction==0) || (x2>=127 && direction==1)) {
         Obstacle::changeDirection();
-        myled1=!myled1;
     }
     if (direction==1) {
         x1 += speed;