![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Adam Baker 201166301
Dependencies: mbed Gamepad N5110
Diff: main.cpp
- Revision:
- 4:cf765fff4e0e
- Parent:
- 3:c1f4968111d7
- Child:
- 5:37b37f48e8bf
diff -r c1f4968111d7 -r cf765fff4e0e main.cpp --- a/main.cpp Thu Mar 21 15:36:38 2019 +0000 +++ b/main.cpp Thu Mar 21 17:25:52 2019 +0000 @@ -23,27 +23,32 @@ lcd.clear(); lcd.drawLine(0,40,84,40,1); - - if (pad.check_event(Gamepad::A_PRESSED) && lcd.getPixel(move.x,move.y+4)) { - move.j++; - } + lcd.drawLine(20,20,20,30,1); + lcd.drawLine(40,30,40,10,1); + //lcd.drawLine(40,30,40,40,1); + lcd.drawCircle(move.x,move.y,3,FILL_BLACK); + float speed = runner.getSpeed(pad); - float speed = runner.getSpeed(pad); - + move = runner.buttonPress(move, lcd, pad); + + move = runner.jump(move, lcd); + + move = runner.wallJumpR(move, lcd, speed); + move = runner.runLeft(move, lcd, speed); move = runner.runRight(move, lcd, speed); - move = runner.fallJump(move, lcd); + move = runner.fall(move, lcd); char buffer[14]; - sprintf(buffer,"x = %f",speed); + sprintf(buffer,"x = %i",move.j); lcd.printString(buffer,0,1); char buffer1[14]; - sprintf(buffer1,"w = %i",move.w); + sprintf(buffer1,"w = %i",move.wjr); lcd.printString(buffer1,0,0); lcd.refresh();