]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
bug fixes
authorClyne Sullivan <tullivan99@gmail.com>
Mon, 26 Oct 2015 12:50:18 +0000 (08:50 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Mon, 26 Oct 2015 12:50:18 +0000 (08:50 -0400)
1  2 
include/entities.h
main.cpp
src/entities.cpp
src/gameplay.cpp

Simple merge
diff --cc main.cpp
Simple merge
index 8100a4c083c4c1f8be0125d211a0a16ac27a6d8d,174495a69807c0c3a3496de952dd9cdeba461720..da096bc2a191ce43d9750127e7488895971be85c
@@@ -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);
  }
  
index 77d00212be60121ab31b21d3c15da1d7d8fd369a,c36b09cd3ec06d98ff4764847988f101df2b9f28..1de542ddea2dbb1ea964afe88493a975983c68f7
@@@ -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.