Haoyan Zhang
/
el17h2z1
deemo1
Diff: Battleship/Battleship.cpp
- Revision:
- 6:b59bc5e15cf3
- Parent:
- 5:32dbfaf578dd
--- a/Battleship/Battleship.cpp Thu May 14 05:21:50 2020 +0000 +++ b/Battleship/Battleship.cpp Thu May 14 06:30:39 2020 +0000 @@ -12,10 +12,11 @@ } -int Battleshipp[3][6] = { - { 0,0,1,1,0,0 }, - { 0,1,1,1,1,0 }, - { 1,1,1,1,1,1 }, +int Battleshipp[4][6] = { + {0,0,1,1,0,0}, + {0,0,1,1,0,0}, + {1,1,1,1,1,1}, + {1,1,1,1,1,1}, }; void Battleship::init(int x,int height, int width) @@ -26,13 +27,13 @@ _width = width; _speed = 1; // default speed _score = 0; // start score from zero - _life = 1; // set the life one + _life = 3; // set the life } void Battleship::draw(N5110 &lcd) { // draw a battleship in screen buffer. - lcd.drawRect(_x,_y,_width,_height,FILL_BLACK); + lcd.drawSprite(_x,_y,_width,_height,(int*)Battleshipp); } void Battleship::update(Direction d,float mag)