Aiming Wu
/
2645_Assignment
Doxyjen of the Bird.h
Wall1/Wall1.cpp
- Committer:
- Wuuu
- Date:
- 2019-05-05
- Revision:
- 0:0aea7b9ba421
File content as of revision 0:0aea7b9ba421:
#include "Wall1.h" Wall1::Wall1() { } Wall1::~Wall1() { } void Wall1::init() { _a1 = 84; _a2 = 28; _a3 = 56; _b1 = 0; _b2 = 15; _b3 = 18; _score = 0; _ab = new int[7]; _ab[0] = 0; _ab[1] = 0; _ab[2] = 0; _ab[3] = 0; _ab[4] = 0; _ab[5] = 0; _ab[6] = 0; } int* Wall1::draw(N5110 &lcd) { if(_a1 == 84){ _b1 = rand() % 8 + 21; } if(_a2 == 84){ _b2 = rand() % 8 + 21; } if(_a3 == 84){ _b3 = rand() % 8 + 21; } _a1 = _a1 - 7; _a2 = _a2 - 7; _a3 = _a3 - 7; lcd.drawRect(_a1,8,7,_b1-7,FILL_BLACK); lcd.drawRect(_a1,_b1 + 15,7,33-_b1,FILL_BLACK); lcd.drawRect(_a2,8,7,_b2-7,FILL_BLACK); lcd.drawRect(_a2,_b2 + 15,7,33-_b2,FILL_BLACK); lcd.drawRect(_a3,8,7,_b3-7,FILL_BLACK); lcd.drawRect(_a3,_b3 + 15,7,33-_b3,FILL_BLACK); _ab[0] = _a1; _ab[1] = _b1; _ab[2] = _a2; _ab[3] = _b2; _ab[4] = _a3; _ab[5] = _b3; _ab[6] = _score; if(_a1 == 0){ _a1 = 84; _score = _score + 10; } if(_a2 == 0){ _a2 = 84; _score = _score + 10; } if(_a3 == 0){ _a3 = 84; _score = _score + 10; } return _ab; }