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.
Diff: main.cpp
- Revision:
- 5:12c179da4788
- Parent:
- 4:0e01cbb95434
- Child:
- 6:39bda45efeed
--- a/main.cpp Sat Mar 23 12:07:33 2019 +0000 +++ b/main.cpp Tue Mar 26 09:16:35 2019 +0000 @@ -24,7 +24,8 @@ #include "N5110.h" #include "Gamepad.h" #include "PlayerControl.h" -#include "Ball.h" +#include "Ball.h" +#include "Map.h" const int fps = 10; //sets the fps of the game doesn't change @@ -33,6 +34,7 @@ Gamepad pad; // Gamepad buttons PlayerControl cont; // Object for player Ball ball; +Map map; ///////////// function prototypes /////////////// void init(); @@ -44,6 +46,7 @@ { init(); welcome(); // waiting for the user to start + render(); } @@ -70,17 +73,19 @@ { for (int i = 1; i < 7; i++) { - pad.led(i,1); - wait(0.1); - pad.led(i,0); + pad.led(i,1); + wait(0.1); + pad.led(i,0); } } } void render() { + map.setCenterpoints(); while(1) { lcd.clear(); // initialise the LCD + map.drawMap(lcd); cont.drawPlayer(lcd); cont.controlPlayer(pad); cont.get_padPos(pad);