/*
* These flags are used elsewhere.
*/
-
+
+ extern unsigned int fontSize;
+
extern bool debug;
extern bool posFlag;
- extern unsigned int fontSize;
- extern bool dialogBoxExists;
+
extern unsigned char dialogOptChosen;
+ extern bool dialogBoxExists;
extern bool dialogImportant;
+ extern bool dialogPassive;
extern unsigned int textWrapLimit;
for(auto &e : entity){
e->loc.y += e->vel.y * delta;
+
if(e->type != STRUCTURET && e->canMove){
e->loc.x += e->vel.x * delta;
+
if(e->vel.x < 0)e->left = true;
- else if(e->vel.x > 0)e->left = false;
-
+ else if(e->vel.x > 0)e->left = false;
}
}
* Handle all remaining entities in this world.
*/
- static int what = 0;
+//LOOOOP:
for(auto &e : entity)
- singleDetect(e);
-
+ std::thread(&World::singleDetect,this,e).detach();
+ //hey->singleDetect(e);
for(auto &part : particles){
int l;
unsigned int i;
}else{
if(part->gravity && part->vely > -2)part->vely-=.003 * deltaTime;
}
- what++;
- }what=0;
+ }
+ for(auto &b : build){
+ switch(b->bsubtype){
+ case FOUNTAIN:
+ for(int r = 0; r < (rand()%25)+10;r++){
+ addParticle( rand()%HLINE*3 + b->loc.x + b->width/2,
+ b->loc.y + b->height,
+ HLINE*1.25,
+ HLINE*1.25,
+ rand()%2 == 0?-(rand()%7)*.01:(rand()%7)*.01,
+ ((4+rand()%6)*.05),
+ {0,0,255},
+ 2500);
+
+ particles.back()->fountain = true;
+ }
+ break;
+ case FIRE_PIT:
+ for(int r = 0; r < (rand()%20)+10;r++){
+ addParticle(rand()%(int)(b->width/2) + b->loc.x+b->width/4, b->loc.y+3*HLINE, HLINE, HLINE, rand()%2 == 0?-(rand()%3)*.01:(rand()%3)*.01,((4+rand()%6)*.005), {255,0,0}, 400);
+ particles.back()->gravity = false;
+ particles.back()->behind = true;
+ }
+ break;
+ default: break;
+ }
+ }
+
+ for(auto &v : village){
+ if(p->loc.x > v.start.x && p->loc.x < v.end.x){
+ if(!v.in){
+ ui::passiveImportantText(5000,"Welcome to %s",v.name.c_str());
+ v.in = true;
+ }
+ }else{
+ v.in = false;
+ }
+ }
+
+ /*if(hey->infront){
+ hey = hey->infront;
+ goto LOOOOP;
+ }*/
}
+
void World::addStructure(BUILD_SUB sub, float x,float y, char *tex, const char *inside){
build.push_back(new Structures());
build.back()->inWorld = this;