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: mbed
Fork of el17dg by
Diff: main/main.cpp
- Revision:
- 27:f05f4e738ba9
- Parent:
- 26:676874c42883
- Child:
- 28:35af3843de8f
--- a/main/main.cpp Sat Apr 06 20:13:33 2019 +0000
+++ b/main/main.cpp Mon Apr 08 14:41:57 2019 +0000
@@ -22,6 +22,7 @@
Gamepad gamepad;
+
AnalogIn pot(PTB2);
AnalogIn x_dir(PTB11);
AnalogIn y_dir(PTB10);
@@ -57,7 +58,7 @@
int main(){
lcd.init();
gamepad.init();
-
+ printf("Intro starts");
intro();
srand(rand_y * 1000000); //Makeing the generated y position for the enemy to be trully random.
@@ -108,18 +109,19 @@
updateAndDrawIntroPartOne();
updateAndDrawIntroPartTwo();
+ wait(1);
//Stop just a few pixels above the bottom screen border.
while (!gamepad.check_event(gamepad.START_PRESSED)){
- //DOES NOT WORK.
- if (start_game_text_counter == 1){
- lcd.printString("Press START",0,0);
- start_game_text_counter = 0;
-
+ lcd.clear();
+ introPartOneText();
+ if (start_game_text_counter == 2){
+ lcd.printString("Press START",10,5);
+ start_game_text_counter = 0;
}
- start_game_text_counter += 1;
+ start_game_text_counter += 1;
+ lcd.refresh();
}
-
}
@@ -143,9 +145,9 @@
void updateAndDrawIntroPartTwo(){
for (int i = 0; i < 19 + 3; i++){
lcd.clear();
-
+ lineThree.y -= 1;
introPartOneText();
- lcd.drawSprite(lineThree.x, lineThree.y - i, 19, 78, (int*)introLineThree);
+ lcd.drawSprite(lineThree.x, lineThree.y, 19, 78, (int*)introLineThree);
lcd.refresh();
wait(0.1);
