diff options
author | tom <tom@apollo> | 2017-01-10 09:49:32 -0600 |
---|---|---|
committer | tom <tom@apollo> | 2017-01-10 09:49:32 -0600 |
commit | f6f6d81c5634f659693914b7b74efcdd39ba5d4f (patch) | |
tree | 5b51e9b82ae36c648e212cc9c95fb8233dc181c1 /src/resource.cpp | |
parent | 20717aeb1b12a7179e7b29c3c8880f18b360a1c8 (diff) |
-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)
Diffstat (limited to 'src/resource.cpp')
-rw-r--r-- | src/resource.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
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() |