aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-26 08:50:18 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-26 08:50:18 -0400
commit69ce4512cae1b286a9807be03dfc295b6a4570f6 (patch)
tree56283d5d4fa9fd3d893ea3f93481a4e6d1c29c33 /src/entities.cpp
parente017c5cbc9f1cf357ca82593e5d2829dd7f729ce (diff)
parent0544b1c561540ee5c86f66b019b160e866acefb3 (diff)
bug fixes
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index 8100a4c..da096bc 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -51,6 +51,8 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation
type = NPCT; //sets type to npc
subtype = 0;
+
+ health = maxHealth = 100;
maxHealth = health = 100;
@@ -68,17 +70,20 @@ Structures::Structures(){ //sets the structure type
}
Mob::Mob(int sub){
- width = HLINE * 10;
- height = HLINE * 8;
type = MOBT;
maxHealth = health = 50;
switch((subtype = sub)){
case MS_RABBIT:
+ width = HLINE * 10;
+ height = HLINE * 8;
tex = new Texturec(2, "assets/rabbit.png", "assets/rabbit1.png");
break;
case MS_BIRD:
+ width = HLINE * 8;
+ height = HLINE * 8;
+ tex = new Texturec(1, "assets/robin.png");
break;
}
@@ -147,6 +152,13 @@ void Entity::draw(void){ //draws the entities
tex->bind(0);
}
break;
+ case 2: //RABBIT
+ if(ground == 0){
+ tex->bind(0);
+ }else if(ground == 1){
+ tex->bind(0);
+ }
+ break;
default:
break;
}