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);
}
}
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);
}
/*
* 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.