summaryrefslogtreecommitdiff
path: root/src/resource.cpp
diff options
context:
space:
mode:
authorTom Barrett <tombarrett@cornell.engr.siu.edu>2015-05-08 10:14:42 -0500
committerTom Barrett <tombarrett@cornell.engr.siu.edu>2015-05-08 10:14:42 -0500
commit39d7fe95633baafe4539f604186b151f30401a39 (patch)
tree242d91eafe56a15db046a1068d8e970624c6abfd /src/resource.cpp
parent76e10e651906b756c4482274cdf1d8ccb686b915 (diff)
parent8c5121486a0e5d94ae5e5ee67370a31530cf8b6f (diff)
Merge branch 'master' of http://github.com/majortom6/natures
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..5044760 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 object
{
- Location L(x,y,2);
+ Location L(xPosition,yPosition,2);
return L;
}