1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
Brick::Brick(int type, int durability) {
this->_durability = durability;
this->_type = type;
this->brickTile.loadFromFile(BRICK_TILE_PATH);
this->_brick.setTexture(this->brickTile);
std::cout << _durability;
switch (type)
{
case 1:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 0, 170, 58));
break;
case 2:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 1, 170, 58));
break;
case 3:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 2, 170, 58));
break;
case 4:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 3, 170, 58));
break;
case 5:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 4, 170, 58));
break;
case 6:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 5, 170, 58));
break;
case 7:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 6, 170, 58));
break;
case 8:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 7, 170, 58));
break;
case 9:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 8, 170, 58));
break;
case 10:
this->_brick.setTextureRect(IntRect(tempX, tempY + distanceY * 9, 170, 58));
break;
}
this->_brick.setScale(0.5f, 0.5f);
}
| |