From edf746b79c8646c2c21c04997d23c94c1ee8adcd Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 8 Oct 2015 09:09:15 -0400 Subject: Added mob class, and basic skirl --- src/gameplay.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gameplay.cpp') diff --git a/src/gameplay.cpp b/src/gameplay.cpp index b6b939a..ac38559 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -8,6 +8,8 @@ extern std::vectorentity; extern std::vectornpc; extern std::vectorbuild; extern Player *player; +extern std::vectormob; + extern void mainLoop(void); @@ -50,11 +52,17 @@ void initEverything(void){ entity.push_back(new Entity()); build.push_back(new Structures()); entity[0]=build[0]; - - build[0]->spawn(STRUCTURET,0,10); + + build[0]->spawn(STRUCTURET,(rand()%120*HLINE),10); IndoorWorld *iw=new IndoorWorld(); iw->generate(200); build[0]->inside=iw; + + entity.push_back(new Mob()); //create a new entity of NPC type + mob.push_back(Mob()); //create new NPC + entity[entity.size()] = &mob[mob.size()-1]; //set the new entity to have the same traits as an NPC + entity[entity.size()-1]->spawn(200,100); //sets the position of the villager around the village + entity.pop_back(); NPCp(entity[1])->addAIFunc(giveTestQuest); for(i=0;i