diff options
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index ae8b4c8..174495a 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -48,6 +48,8 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation type = NPCT; //sets type to npc subtype = 0; + + health = maxHealth = 100; tex = new Texturec(1,"assets/NPC.png"); inv = new Inventory(NPC_INV_SIZE); @@ -63,14 +65,17 @@ Structures::Structures(){ //sets the structure type } Mob::Mob(int sub){ - width = HLINE * 10; - height = HLINE * 8; type = MOBT; //sets type to MOB subtype = sub; //SKIRL - if(subtype == 1){//RABBIT + if(sub == 1){//RABBIT + width = HLINE * 10; + height = HLINE * 8; tex = new Texturec(2, "assets/rabbit.png", "assets/rabbit1.png"); - }else if(subtype == 2){//BIRD + }else if(sub == 2){//BIRD //add bird textures and bird things + width = HLINE * 8; + height = HLINE * 8; + tex = new Texturec(1, "assets/robin.png"); } inv = new Inventory(NPC_INV_SIZE); } @@ -137,6 +142,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; } |