From f6f6d81c5634f659693914b7b74efcdd39ba5d4f Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 10 Jan 2017 09:49:32 -0600 Subject: -Replaced images with colored rectangles -Removed various functions and variables pertaining to such images -Started migrating all uses of Location to SDL_Rect (I would preferably completly remove Location.hpp) -Scaled down resolution to 1080x640 (I would like to make these global constants) --- src/resource.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/resource.cpp') diff --git a/src/resource.cpp b/src/resource.cpp index 08929bc..0c07be3 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -1,27 +1,29 @@ #include "resource.hpp" -Resource::Resource(Window m, std::string s) -{ - texture = loadTexture(s, m); - renderer = m.getRenderer(); - - L.y = rand()%800; - L.x = rand()%1200; +Resource::Resource(Window m, int size) +{ + Init(m); type = 2; + rect.h = rect.w = size; + + L.x = rect.x; + L.y = rect.y; + amount = 100; } -Resource::Resource(Window m, std::string s, Location z) +Resource::Resource(Window m, int size, Location z) { - texture = loadTexture(s, m); - renderer = m.getRenderer(); - - L.y = z.y; - L.x = z.x; + Init(m,z); type = 2; - - amount = 100; + + rect.h = rect.w = size; + + L.x = rect.x; + L.y = rect.y; + + amount = 200; } void Resource::eat() -- cgit v1.2.3