![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Adam Baker 201166301
Dependencies: mbed Gamepad N5110
Diff: main.cpp
- Revision:
- 17:ecbafe932c19
- Parent:
- 16:b0c0b1fc65d6
- Child:
- 18:0a0976faedfb
--- a/main.cpp Mon Apr 01 12:35:05 2019 +0000 +++ b/main.cpp Mon Apr 01 17:25:59 2019 +0000 @@ -21,11 +21,12 @@ int main() { - int fps = 10; - + int fps = 6; + int d = 0 ; // direction of moving plats + pad.init(); lcd.init(); - lcd.setContrast(0.5); + lcd.setContrast(0.55); Move move; //Pos pos; @@ -47,7 +48,7 @@ move = runner.nextLevel(move); //must happen befofre 'fall' otherwise runner can fall out of screen - runner.whatLevel(move, lcd); + d = runner.whatLevel(move, lcd); move = runner.buttonPress(move, lcd, pad); @@ -60,18 +61,21 @@ move = runner.runLeft(move, lcd, speed); move = runner.runRight(move, lcd, speed); + + move = runner.cancelSprint(move, lcd, speed); move = runner.fall(move, lcd); move = runner.runnerState(move, lcd, speed); //what state runner is in (must come after next level - runner.whatLevel(move, lcd); // call level(why again)?? + d = runner.whatLevel(move, lcd); // call level(why again)?? + move = runner.onPlatform(move, d); - //char buffer[14]; - //sprintf(buffer,"%i",pos.d); - //lcd.printString(buffer,0,1); + char buffer[14]; + sprintf(buffer,"%i",d); + lcd.printString(buffer,0,1); //sleep(); //sleep untill next refresh