{
texture = txtr;
sprite.setTexture(texture);
- //position = {500, 500};
- position ={rand()%static_cast<int>(S_WIDTH*5/7.0f - S_WIDTH/5.0f +1) + S_WIDTH/5.0f, S_HEIGHT}; //x-pixel WIDTH/5 - WIDTH*5/7
- //sprite.setScale(params["scale"][0], params["scale"][1]);
+ position ={rand()%static_cast<int>(S_WIDTH*5/7.0f - S_WIDTH/5.0f +1)
+ + S_WIDTH/5.0f, S_HEIGHT};
sprite.setScale(params["scale"][0],params["scale"][1]);
sf::FloatRect gb {sprite.getGlobalBounds()};
sprite.setOrigin(gb.width / 2, gb.height / 2);