diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-10-08 09:09:15 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-10-08 09:09:15 -0400 |
commit | edf746b79c8646c2c21c04997d23c94c1ee8adcd (patch) | |
tree | 10479cd0a9868a4678af8acb5ebaf8f2c4d8dc7c /src/gameplay.cpp | |
parent | 281da1f81b1eef9e05e881e12d986b6b45ce8696 (diff) |
Added mob class, and basic skirl
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 b6b939a..ac38559 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); @@ -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<entity.size()+1;i++){ |