diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-10-08 09:12:18 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-10-08 09:12:18 -0400 |
commit | c88533e59e961a029f6bb4777932434a9ca517f4 (patch) | |
tree | 96a384874d8e9f49becc989fcc535f8d511a0c34 /src/gameplay.cpp | |
parent | 6e9eda2e22e79a90395387f4014c975044ea8d05 (diff) | |
parent | edf746b79c8646c2c21c04997d23c94c1ee8adcd (diff) |
merge
Diffstat (limited to 'src/gameplay.cpp')
-rw-r--r-- | src/gameplay.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gameplay.cpp b/src/gameplay.cpp index a690203..57132f5 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -8,6 +8,8 @@ extern std::vector<Entity*>entity; extern std::vector<NPC>npc; extern std::vector<Structures *>build; extern Player *player; +extern std::vector<Mob>mob; + extern void mainLoop(void); @@ -56,11 +58,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<entity.size()+1;i++){ |