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

Resource::Resource(Window m, SDL_Rect R)
{	
    renderer = m.getRenderer();
    type = 2;
    rect = R;
    
    if(rect.x == 0 && rect.y == 0){
        rect.x = rand()%WINDOW_X;
        rect.y = rand()%WINDOW_Y;
    }

	amount = RESOURCE_AMOUNT;
}

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