summaryrefslogtreecommitdiff
path: root/src/resource.cpp
blob: 6a228fe46c0b983074add737be56b57c77e5adae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "resource.hpp"

Resource::Resource(Window m, std::string s) //Constructor
{
	texture = loadTexture(s, m);
	renderer = m.getRenderer();

	//Initialized random position coordinates
	yPosition = rand()%800;
	xPosition = rand()%1200;
}

Resource::Resource(Window m, std::string s, Location z)
{
	texture = loadTexture(s, m);
	renderer = m.getRenderer();

	yPosition = z.y;
	xPosition = z.x;
}

Location Resource::getLocation() //Returns resource object
{
	Location L(xPosition,yPosition,2);
	return L;
}