summaryrefslogtreecommitdiff
path: root/src/resource.cpp
blob: 8f1a4cfbcbda74c0fd6a23e6c0770b788e307f14 (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
27
28
29
30
31
32
33
34
#include "resource.hpp"

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

	yPosition = rand()%800;
	xPosition = rand()%1200;

	amount = 100;
}

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

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

	amount = 100;
}

Location Resource::getLocation() 
{
	Location L(xPosition,yPosition,2);
	return L;
}

void Resource::eat()
{
	amount-=10;
}