summaryrefslogtreecommitdiff
path: root/src/resource.cpp
diff options
context:
space:
mode:
authormajortom6 <tombarrett@siu.edu>2017-02-26 11:14:31 -0600
committerTom Barrett <tombarrett@siu.edu>2017-03-07 13:23:42 -0600
commit7394b069537ed7a490a343381d62862eb22abdcf (patch)
treec8bff4f88cf962ec4148a2e133bf959035feedb7 /src/resource.cpp
parente54170cfb8c0fb99ecdc3b1e57e832dec58ee76e (diff)
-REMOVED ENTITY, RESOURCE, AND CREATURE !
-replaced them all with one class, organism (always subject to change) -the dna type now is what differs creatures and resources -removed dead constants -may be a rogue segfault -also weird artifacts start showing if running long
Diffstat (limited to 'src/resource.cpp')
-rw-r--r--src/resource.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/resource.cpp b/src/resource.cpp
deleted file mode 100644
index c3e61d6..0000000
--- a/src/resource.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "resource.hpp"
-
-Resource::Resource(Rectangle r)
-{
- rect = r;
-
- if(rect.x == 0 && rect.y == 0){
- rect.x = getRandom(30);
- rect.y = getRandom(30);
- }
-
- gfxData = GraphicsData(rect.x, rect.y, 0, 1, 0, RESOURCE_SIDES);
-
- type = RESOURCE_TYPE;
- amount = RESOURCE_AMOUNT_START;
- growAmount = RESOURCE_GROW;
-}
-
-void Resource::eat(int bite)
-{
- amount-=bite;
-}
-
-void Resource::grow()
-{
- if(amount < RESOURCE_AMOUNT_MAX){
- amount+=growAmount;
- rect.h = rect.w = map(amount,0,RESOURCE_AMOUNT_MAX,0,RESOURCE_SIZE_MAX);
- }
-}