![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Adam Baker 201166301
Dependencies: mbed Gamepad N5110
Diff: main.cpp
- Revision:
- 12:1253afc5d536
- Parent:
- 11:dcb38924d96b
- Child:
- 13:35a459a33bbd
--- a/main.cpp Sun Mar 24 20:03:50 2019 +0000 +++ b/main.cpp Sun Mar 24 22:47:33 2019 +0000 @@ -13,7 +13,7 @@ int main() { - int fps = 12; + int fps = 8; pad.init(); lcd.init(); @@ -28,8 +28,7 @@ float speed = runner.getSpeed(pad); - //lcd.drawCircle(move.x,move.y,3,FILL_BLACK); - runner.runnerState(move, lcd, speed); + //runner.runnerState(move, lcd, speed); move = runner.nextLevel(move); //must happen befofre 'fall' otherwise runner can fall out of screen @@ -49,16 +48,24 @@ move = runner.fall(move, lcd); + runner.runnerState(move, lcd, speed); //what state runner is in (must come after next level + runner.whatLevel(move, lcd); // call level /**char buffer[14]; sprintf(buffer,"%i",move.l); lcd.printString(buffer,0,1); */ + int test; + if (ani.pixelsLeft(move.x, move.y, lcd) == true) { + test = 1; + } else { + test = 0; + } char buffer1[14]; - sprintf(buffer1,"%i",move.f); + sprintf(buffer1,"%i",test); lcd.printString(buffer1,0,0);