Doxygen comments added

Dependencies:   mbed Gamepad N5110

Pipes/Pipes.cpp

Committer:
rafeh
Date:
2019-05-08
Revision:
10:75de0f4da176
Parent:
7:05f433e196d6
Child:
14:9a9ac55616c4

File content as of revision 10:75de0f4da176:

#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
    lcd.drawRect((_x-1),_height,8,3,FILL_BLACK);
    lcd.drawRect((_x-1),(_height+23),8,3,FILL_BLACK);
    lcd.drawRect(_x,(_height+26),6,(84-(_height+26)),FILL_BLACK); //draw the bottom
    }
  
int Pipes::generate_height() {  //generates height for the top pipe. a random integer between 0 and 25 is generated
         int _random_height=rand() % (25 + 1 - 0) + 0;
    return _random_height;
    }