From: Clyne Sullivan Date: Thu, 22 Oct 2015 13:27:55 +0000 (-0400) Subject: screw npcs X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=c99d7fb5e5c047709ccd4823e39ccb16c153eecb;p=clyne%2Fgamedev.git screw npcs --- c99d7fb5e5c047709ccd4823e39ccb16c153eecb diff --cc src/entities.cpp index ce983e8,092ab7b..7a4da65 --- a/src/entities.cpp +++ b/src/entities.cpp @@@ -33,10 -33,14 +33,11 @@@ Player::Player(){ //sets all of the pla subtype = 0; maxHealth = 100; health = maxHealth; - texture[0] = loadTexture("assets/player.png"); - texture[1] = loadTexture("assets/player1.png"); - texture[2] = loadTexture("assets/player2.png"); + alive = true; + ground = false; + near = true; - texture[0] = 0; - texture[1] = 0; - texture[2] = 0; inv = new Inventory(PLAYER_INV_SIZE); + tex = new Texturec(3, "assets/player.png", "assets/player1.png", "assets/player2.png"); } NPC::NPC(){ //sets all of the NPC specific traits on object creation @@@ -247,10 -288,35 +285,18 @@@ unsigned int Structures::spawn(_TYPE t width = 50 * HLINE; height = 40 * HLINE; + /* + * tempN is the amount of entities that will be spawned in the village. As of 10/21/2015 the village + * can spawn bewteen 2 and 7 villagers for the starting hut. + */ int tempN = (getRand() % 5 + 2); //amount of villagers that will spawn for(int i=0;ispawn(loc.x + (float)(i - 5),100); //sets the position of the villager around the village + NPCp(entity[entity.size()-1])->spawn(loc.x + (float)(i - 5),100); //sets the position of the villager around the village } return entity.size(); }