cleanup in YF.cc file, Alma och Malin
authorAlma Dejus <almde515@student.liu.se>
Mon, 11 Dec 2023 08:47:02 +0000 (09:47 +0100)
committerAlma Dejus <almde515@student.liu.se>
Mon, 11 Dec 2023 08:47:02 +0000 (09:47 +0100)
src/YF.cc

index 831812b4a727618b84d2ffc37ab4472306bc5968..aa897c5bce0e6b6ee637a43b5b46d83ba57e2574 100644 (file)
--- 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<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);