summaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authortom <tombarrett@siu.edu>2017-01-21 08:58:12 -0600
committertom <tombarrett@siu.edu>2017-01-21 08:58:12 -0600
commita9281bfcf21861e621a3243ecb633a299c8d8e52 (patch)
tree7d4687fd9a8f40e806e6b7c8803c0e87fcae6639 /src/entity.cpp
parentccb66c8d6d175b1bd3d8ecaa540e80baac5181b6 (diff)
-took basic math functions and put it into functions.hpp
-spaced various lines -reorganized variables by datatype -implemented reproduction -reorganized pathing so once a target is set, the creature checks if that same target is near every cycle
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 6ad0e3f..a2c2d87 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -2,9 +2,16 @@
void Entity::Place()
{
- if(type == 1)
- SDL_SetRenderDrawColor(renderer,255,0,255,255);
- else
+ if(type == CREATURE_TYPE){
+ if(gender)
+ SDL_SetRenderDrawColor(renderer,255,0,0,255);
+ else
+ if(pregnate)
+ SDL_SetRenderDrawColor(renderer,255,0,255,255);
+ else
+ SDL_SetRenderDrawColor(renderer,0,0,255,255);
+ }
+ else if (type == RESOURCE_TYPE)
SDL_SetRenderDrawColor(renderer,0,255,0,255);
SDL_RenderFillRect(renderer, &rect);