Doxygen comments added
Dependencies: mbed Gamepad N5110
Pipes/Pipes.cpp
- Committer:
- rafeh
- Date:
- 2019-05-09
- Revision:
- 14:9a9ac55616c4
- Parent:
- 10:75de0f4da176
File content as of revision 14:9a9ac55616c4:
#include "Pipes.h" Pipes::Pipes() { } Pipes::~Pipes() { } void Pipes::init(int x, int height) { _x = x; _height = height; } void Pipes::draw(N5110 &lcd) { lcd.drawRect(_x,0,6,_height,FILL_BLACK); //draw the top pipe (width 6 pixels) lcd.drawRect((_x-1),_height,8,3,FILL_BLACK); //draw the top middle slightly wider pipe (width 8 pixels) lcd.drawRect((_x-1),(_height+23),8,3,FILL_BLACK); //draw the bottom middle slightly wider pipe (width 8 pixels) lcd.drawRect(_x,(_height+26),6,(84-(_height+26)),FILL_BLACK); //draw the bottom pipe (width 6 pixels) } int Pipes::generate_height() { //generates height for the top pipe in pixels. a random integer between 0 and 25 is generated int _random_height=rand() % (25 + 1 - 0) + 0; return _random_height; }