Uses accompanying Basket, Objects and Fruit libraries to create Fruit Basket game. If an object is caught, points are added; if an object in missed, a 'life' is lost.
Dependents: Game_Controller_Project
Diff: Catch_Model.cpp
- Revision:
- 16:dae98691cc0e
- Parent:
- 15:1a0bd800f1f1
diff -r 1a0bd800f1f1 -r dae98691cc0e Catch_Model.cpp --- a/Catch_Model.cpp Fri Apr 28 17:15:01 2017 +0000 +++ b/Catch_Model.cpp Thu May 04 10:29:56 2017 +0000 @@ -63,6 +63,8 @@ objects.undraw(lcd); //FILL_WHITE so object disappears add_score(); //object has a variable that adds correct amount of score objects.init(_objects_speed); //drop another object upon contact + + //printf("basket catch\n"); } } @@ -82,7 +84,9 @@ } pad.tone(100, 0.2); objects.init(_objects_speed); //drop another object upon contact - } + + //printf("basket miss\n"); + } } //Check which object is current and add appropriate score @@ -102,6 +106,7 @@ } else { //antifruit - if caught, reduce lives instead of add score _lives--; } + //printf("add score\n"); } //Return number of lives @@ -125,6 +130,8 @@ //...in 10 seconds _delay = 1, A and B can be used again _delay = 0; timeout.attach(this, &Catch_Model::set_delay, 10.0); + + //printf("A pressed\n"); } } @@ -142,6 +149,8 @@ //...in 10 seconds _delay = 1, A and B can be used again _delay = 0; timeout.attach(this, &Catch_Model::set_delay, 10.0); + + //printf("B pressed\n"); } }