ZIWEI LIU
/
ELEC2645_Project_el19z2l
201377806 ZiWei Liu
Diff: main.cpp
- Revision:
- 2:d621a4cbe0c2
- Parent:
- 1:11854f815cc8
- Child:
- 3:e53e289cd4ba
--- a/main.cpp Thu May 14 06:54:58 2020 +0000 +++ b/main.cpp Fri May 15 09:04:00 2020 +0000 @@ -14,14 +14,22 @@ #include "mbed.h" #include "Gamepad.h" #include "N5110.h" +#include "DodgeEngine.h" +#include "Character.h" +#include "Block.h" +#include "ctime" //objects Gamepad pad; N5110 lcd; +DodgeEngine dodge; +Character character; +Block block; //prototypes void init(); void welcome(); +void refreshing(); int main() { @@ -30,6 +38,18 @@ //initialize init(); welcome(); + + + pad.leds_off(); + refreshing(); + wait(1.0f/fps); + + block.blockinit(); + while (1) { + dodge.dodgeupdate(); + refreshing(); + wait(1.0f/fps); + } } @@ -64,3 +84,12 @@ pad.led(6,1); } } + +void refreshing(){ + + lcd.clear(); + dodge.charactermove(lcd,pad); + dodge.blockmove(lcd); + lcd.refresh(); + +} \ No newline at end of file