aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-05 08:49:36 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-05 08:49:36 -0400
commit66bdd492971199bac94511320be53ae6a834e7d8 (patch)
tree4bd504df7129b4a6e9ef3cc1d4f7dad206e0a4af /src/entities.cpp
parent09e5e28f56d906b3ad4347eaa9e5d1f9cf9afeab (diff)
parent2957819d01ed2d9d7bc71408a7431f9add8d51c5 (diff)
Merge branch 'master' of https://github.com/tcsullivan/gamedev
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index 85ba538..42f93c8 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -32,6 +32,8 @@ void Entity::draw(void){ //draws the entities
glColor3ub(255,255,0);
glRectf(loc.x+width/3,loc.y+height,loc.x+width*2/3,loc.y+height+width/3);
}
+ }if(type==STRUCTURET){
+ glColor3ub(255,255,255);
}
if(left){
glScalef(-1.0f,1.0f,1.0f);
@@ -150,6 +152,7 @@ Structures::Structures(){ //sets the structure type
speed = 0;
alive = true;
near = false;
+ texture = loadTexture("assets/house1.png");
}
unsigned int Structures::spawn(_TYPE t, float x, float y){ //spawns a structure based off of type and coords
@@ -162,8 +165,8 @@ unsigned int Structures::spawn(_TYPE t, float x, float y){ //spawns a structure
//spawns between 1 and 5 villagers around the village
if(type == STRUCTURET){
loc.y=100;
- width = 20 * HLINE;
- height = 20 * HLINE;
+ width = 30 * HLINE;
+ height = 30 * HLINE;
int tempN = (getRand() % 5 + 2); //amount of villagers that will spawn
for(int i=0;i<tempN;i++){