From c63d77ddddb69ef0f641d90a8c3922fdc356224c Mon Sep 17 00:00:00 2001 From: dakjos Date: Thu, 7 May 2015 19:53:39 -0500 Subject: Some variable names changed and many comments made so I understand what the fuck is going on --- src/resource.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/resource.cpp') diff --git a/src/resource.cpp b/src/resource.cpp index a087aca..c4a9341 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -1,17 +1,19 @@ #include "resource.hpp" -Resource::Resource(Window m, std::string s) +Resource::Resource(Window m, std::string s) //Constructor { texture = loadTexture(s, m); renderer = m.getRenderer(); - int zy = rand()%800; - int zx = rand()%1200; - y=zy; - x=zx; + + //Initialized random position coordinates + int yStart = rand()%800; + int xStart = rand()%1200; + yPosition = yStart; + xPosition = xStart; } -Location Resource::getLocation() +Location Resource::getLocation() //Returns resource location vector { - Location L(x,y,2); + Location L(xPosition,yPosition,2); return L; } -- cgit v1.2.3