Aiming Wu
/
Game
Implement basic functions.
Diff: Copter/Copter.cpp
- Revision:
- 0:7173d91b03e1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Copter/Copter.cpp Fri May 03 13:03:59 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