Aiming Wu
/
2645_Assignment
Doxyjen of the Bird.h
Diff: Bird/Bird.cpp
- Revision:
- 0:0aea7b9ba421
diff -r 000000000000 -r 0aea7b9ba421 Bird/Bird.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bird/Bird.cpp Sun May 05 16:27:50 2019 +0000 @@ -0,0 +1,54 @@ +#include "Bird.h" + +Bird::Bird() +{ + +} + +Bird::~Bird() +{ + +} + +void Bird::init() +{ + _h = 16; +} + +int Bird::draw(N5110 &lcd,Gamepad &pad) +{ + int sprite_data1[] = { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,1,0,0,0,0, + 0,0,0,1,1,0,0,0, + 0,0,0,1,1,1,0,0, + 0,0,0,1,1,1,0,0, + 1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + }; + int sprite_data2[] = { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,0, + 1,1,1,1,1,1,1,1, + 0,0,0,1,1,1,0,0, + 0,0,0,1,1,1,0,0, + 0,0,0,1,1,0,0,0, + 0,0,0,1,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + }; + if(pad.check_event(Gamepad::A_PRESSED) == true){ + _h = _h - 7; + Bitmap sprite(sprite_data1, 10, 8); + sprite.render(lcd,1,_h); + }else{ + _h = _h + 3; + Bitmap sprite(sprite_data2, 10, 8); + sprite.render(lcd,1,_h); + } + return _h; +} \ No newline at end of file