ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_PROJECT_EL18KK

Dependencies:   mbed

Revision:
15:5bf3f951d337
Parent:
9:e6566d09f087
Child:
20:c697902b844f
diff -r 652fd55aebcf -r 5bf3f951d337 SplashScreen/Splash.cpp
--- a/SplashScreen/Splash.cpp	Mon May 18 14:54:29 2020 +0000
+++ b/SplashScreen/Splash.cpp	Mon May 18 18:03:43 2020 +0000
@@ -162,8 +162,8 @@
        
     };
     
-int ball_x = 33;
-int ball_y = 17;
+int ball_x = 39;
+int ball_y = 21;
 
 Splash::Splash(N5110 &lcd, Ball &ball) {
     _lcd = &lcd;
@@ -191,7 +191,7 @@
         _lcd->clear();
         _lcd->setContrast(0);
         draw_name();
-        _ball->setLocation(ball_x,ball_y);
+        _ball->drawBall(ball_x, ball_y, 6);
         contrast_slide();
         wait(1);
         player_enter_animation();
@@ -204,14 +204,14 @@
 void Splash::drawLogo(int x, int y) {
         _lcd->drawSprite(x,y,15,9,(int*)letter_S);
         _lcd->drawSprite((x+9),y,15,9,(int*)letter_h);//+9
-        _ball->setLocation((x+18),(y+3));//+32 +3
-        _ball->setLocation((x+32),(y+3));//+32 +3
+        _ball->drawBall((x+24),(y+7), 6);//+9 +12
+        _ball->drawBall((x+38),(y+7), 6);//+32 +3
         _lcd->drawSprite((x+47),y,15,9,(int*)letter_t);//+47
     }   
 void Splash::draw_name() {
         _lcd->drawSprite(15,14,15,9,(int*)letter_S);
         _lcd->drawSprite(24,14,15,9,(int*)letter_h);
-        _ball->setLocation(47,17);
+        _ball->drawBall(53, 21, 6);
         _lcd->drawSprite(62,14,15,9,(int*)letter_t);
         _lcd->printString("Game by",21,4);
         _lcd->printString("Kaif Kutchwala",0,5);    
@@ -232,7 +232,7 @@
         _lcd->clear(); //clear screen before starting animation
         _lcd->drawSprite(sprite_X,sprite_Y,20,15,(int*)player_fsm[0]);
         draw_name();
-        _ball->setLocation(ball_x,ball_y);
+        _ball->drawBall(ball_x,ball_y, 6);
         //printf("%d \n",sprite_X);
         //printf("%d \n",sprite_Y);
         _lcd->refresh();
@@ -264,7 +264,7 @@
         }
         _lcd->drawSprite(35,0,20,15,(int*)player_fsm[state]);
         draw_name();
-        _ball->setLocation(ball_x,ball_y);
+        _ball->drawBall(ball_x,ball_y, 6);
         _lcd->refresh();
         _lcd->clear();
         wait(0.1);
@@ -273,7 +273,7 @@
         while(ball_x != -7 && ball_y != 48){
                 _lcd->drawSprite(35,0,20,15,(int*)player_fsm[4]);
                 draw_name();
-                _ball->setLocation(ball_x, ball_y);
+                _ball->drawBall(ball_x, ball_y, 6);
                 _lcd->refresh();
                 _lcd->clear();
                 ball_x--;