summaryrefslogtreecommitdiff
path: root/src/resource.cpp
diff options
context:
space:
mode:
authordakjos <dsojka@siu.edu>2015-05-07 19:53:39 -0500
committerdakjos <dsojka@siu.edu>2015-05-07 19:53:39 -0500
commitc63d77ddddb69ef0f641d90a8c3922fdc356224c (patch)
tree6867ee8ee11718eca9bb144b98f17c695a891495 /src/resource.cpp
parentffcee12acf3fe3f972f322c18b3203212682205d (diff)
Some variable names changed and many comments made so I understand what the fuck is going on
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;
}