![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Adam Baker 201166301
Dependencies: mbed Gamepad N5110
Diff: main.cpp
- Revision:
- 21:f82573f3e40e
- Parent:
- 20:54724f686c14
- Child:
- 22:8218092c2e4b
--- a/main.cpp Mon Apr 08 18:55:49 2019 +0000 +++ b/main.cpp Wed Apr 10 11:39:11 2019 +0000 @@ -23,11 +23,13 @@ int fps = 6; //6 int d = 0 ; // direction of moving plats - int l = 0; + int l = 0; //length int r = 0; int d2 = 0; int l2 = 0; int r2 = 0; + int d3 = 0; + int d4 = 0; pad.init(); lcd.init(); @@ -55,7 +57,7 @@ pos = lev.whatLevel(lcd, move.l); - move = runner.buttonPress(move, lcd, pad); + move = runner.buttonPress(move, lcd, pad, d3, d4); move = runner.jump(move, lcd); @@ -71,26 +73,30 @@ move = runner.fall(move, lcd); - move = runner.runnerState(move, lcd, speed); //what state runner is in (must come after next level + move = runner.runnerState(move, lcd, speed, d3, d4); //what state runner is in (must come after next level //runner.whatLevel(move, lcd); // call level(why again)?? - d = runner.onVerCheck(move, pos); + d = runner.onHozCheck(move, pos); - r = runner.byVerCheckRight(move, pos); + r = runner.byHozCheckRight(move, pos); - l = runner.byVerCheckLeft(move, pos); + l = runner.byHozCheckLeft(move, pos); - d2 = runner.onVer2Check(move, pos); + d2 = runner.onHoz2Check(move, pos); - r2 = runner.byVer2CheckRight(move, pos); + r2 = runner.byHoz2CheckRight(move, pos); + + l2 = runner.byHoz2CheckLeft(move, pos); - l2 = runner.byVer2CheckLeft(move, pos); + d3 = runner.onVerCheck(move, pos); - move = runner.onPlatform(lcd, move, d, r, l, d2, r2, l2); + d4 = runner.onVer2Check(move, pos); + + move = runner.onPlatform(lcd, move, d, r, l, d2, r2, l2, d3, d4); char buffer[14]; - sprintf(buffer,"%i %i %i %i %i" ,pos.x, pos.y, pos.d, pos.c, pos.l); + sprintf(buffer,"%i %i %i %i" ,d, d2, d3, d4); lcd.printString(buffer,0,0); char buffer1[14]; sprintf(buffer1,"%i %i %i %i %i",pos.vx, pos. vy, pos.vd, pos.vc, pos.vl);