From: Alma Dejus Date: Mon, 11 Dec 2023 08:47:02 +0000 (+0100) Subject: cleanup in YF.cc file, Alma och Malin X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=330e76e9e61f43d951e3a0941fa10d4875d257e5;p=TDDC76_proj.git cleanup in YF.cc file, Alma och Malin --- diff --git a/src/YF.cc b/src/YF.cc index 831812b..aa897c5 100644 --- a/src/YF.cc +++ b/src/YF.cc @@ -9,9 +9,8 @@ YF::YF(sf::Texture& txtr, json& params) : max_speed{params["max_speed"]} { texture = txtr; sprite.setTexture(texture); - //position = {500, 500}; - position ={rand()%static_cast(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(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);