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 Gamepad N5110
Diff: main.cpp
- Revision:
- 17:ecbafe932c19
- Parent:
- 16:b0c0b1fc65d6
- Child:
- 18:0a0976faedfb
diff -r b0c0b1fc65d6 -r ecbafe932c19 main.cpp
--- 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