summaryrefslogtreecommitdiff
path: root/src/resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resource.cpp')
-rw-r--r--src/resource.cpp16
1 files changed, 9 insertions, 7 deletions
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;
}