CBlockType2::CBlockType2(const int &x, const int &y) :CBlock(x,y) { for (int i = 0; i < getBlockNum(); i++) { CRectangle *temp = new CRectangle(x, y + ((i * 2) * 16), 16); temp->setColor(getColor()); setRectArr(i, temp); } }
void CBlockType2::reBuild() { for (int i = 0; i < getBlockNum(); i++) { delete getRectArr()[i]; } setBlockNum(rand() % 3 + 4); for (int i = 0; i < getBlockNum(); i++) { CRectangle *temp = new CRectangle(getX(), getY() + ((i * 2) * 16), 16); temp->setColor(getColor()); setRectArr(i, temp); } }