From: Clyne Sullivan Date: Mon, 26 Oct 2015 12:50:18 +0000 (-0400) Subject: bug fixes X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=69ce4512cae1b286a9807be03dfc295b6a4570f6;p=clyne%2Fgamedev.git bug fixes --- 69ce4512cae1b286a9807be03dfc295b6a4570f6 diff --cc src/entities.cpp index 8100a4c,174495a..da096bc --- a/src/entities.cpp +++ b/src/entities.cpp @@@ -51,9 -48,9 +51,11 @@@ NPC::NPC(){ //sets all of the NPC speci type = NPCT; //sets type to npc subtype = 0; + + health = maxHealth = 100; + maxHealth = health = 100; + tex = new Texturec(1,"assets/NPC.png"); inv = new Inventory(NPC_INV_SIZE); } @@@ -68,20 -65,18 +70,23 @@@ Structures::Structures(){ //sets the st } Mob::Mob(int sub){ - width = HLINE * 10; - height = HLINE * 8; - type = MOBT; //sets type to MOB - subtype = sub; //SKIRL - if(sub == 1){//RABBIT - width = HLINE * 10; + 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"); - }else if(sub == 2){//BIRD - //add bird textures and bird things + break; + case MS_BIRD: + width = HLINE * 8; + height = HLINE * 8; + tex = new Texturec(1, "assets/robin.png"); + break; } + inv = new Inventory(NPC_INV_SIZE); } diff --cc src/gameplay.cpp index 77d0021,c36b09c..1de542d --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@@ -78,11 -78,14 +78,15 @@@ void initEverything(void) /* * Spawn a mob. - */ - mob.push_back(new Mob(1)); + */ + + mob.push_back(new Mob(MS_RABBIT)); entity.push_back(mob.back()); mob.back()->spawn(200,100); + + mob.push_back(new Mob(2)); + entity.push_back(mob.back()); + mob.back()->spawn(200,100); /* * Link all the entities that were just created to the initial world, and setup a test AI function.