Aiming Wu
/
2645_Assignment
Doxyjen of the Bird.h
Diff: Copter/Copter.cpp
- Revision:
- 0:0aea7b9ba421
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Copter/Copter.cpp Sun May 05 16:27:50 2019 +0000 @@ -0,0 +1,53 @@ +#include "Copter.h" + +Copter::Copter() +{ + +} + +Copter::~Copter() +{ + +} + +void Copter::init() +{ + _score = 0; + _h = 0; +} + +Vector2D Copter::get_coord(Gamepad &pad) +{ + _ans = pad.get_coord(); + return _ans; +} + +int Copter::get_h() +{ + _h = 17 * _ans.y; + return _h; +} + +void Copter::draw(N5110 &lcd) +{ + int sprite_data[] = { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,1,1,1,1,1,0, + 0,0,0,0,1,0,0,0, + 0,0,0,1,1,1,0,0, + 0,0,1,1,1,1,1,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, + }; + Bitmap sprite(sprite_data, 10, 8); + sprite.render(lcd,1,19 - _h); +} + +int Copter::get_score() +{ + _score++; + return _score; +} \ No newline at end of file