- fixed NPC generation
- added enumerators for entity types
- improved NPC wandering
+
+9/29/2015:
+==========
+
+ - made world handling work with interpolation
+ - successfully ran game 200 entities
+ - improved debug screen
+
height = 16 * HLINE;
int tempN = (getRand() % 5 + 1); //amount of villagers that will spawn
- //int tempN=200;
for(int i=0;i<tempN;i++){
entity.push_back(new NPC()); //create a new entity of NPC type
npc.push_back(NPC()); //create new NPC
debugDiv=0;
rndy = player->loc.y;
}
- ui::putText(player->loc.x-SCREEN_WIDTH/2,SCREEN_HEIGHT-ui::fontSize,"FPS: %d\nD: %d G:%d\nRes: %ux%u\nE: %d\nPOS: (x)%.2f\n (y)%.2f",fps,d,player->ground,SCREEN_WIDTH,SCREEN_HEIGHT,entity.size(),player->loc.x,rndy);
+ ui::putText(player->loc.x-SCREEN_WIDTH/2,SCREEN_HEIGHT-ui::fontSize,"FPS: %d\nD: %d G:%d\nRes: %ux%u\nE: %d\nPOS: (x)%+.2f\n (y)%+.2f",
+ fps,d,player->ground,SCREEN_WIDTH,SCREEN_HEIGHT,entity.size(),player->loc.x,rndy);
}
ui::draw(); // Draw any UI elements if they need to be
int mx = ui::mouse.x, my=ui::mouse.y;
my = 720 - my;
mx -= (SCREEN_WIDTH/2);
+ glColor3ub(0,0,0);
glRectf(mx + player->loc.x, my, mx + player->loc.x + HLINE * 1, my + HLINE * 1);
h=ftf->glyph->bitmap.rows;
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,ftex);
+ if(c=='-')y+=fontSize/3;
glBegin(GL_QUADS);
glColor3ub(255,255,255);
glTexCoord2f(0,1);glVertex2f(x,y);
cline[i].y-=(yoff-DRAW_Y_OFFSET); // Reset 'cline[i]'`s y to what it was
}
glEnd();
- for(i=0;i<entity.size()+1;i++){
- if(entity[i]->inWorld==this){
- entity[i]->draw();
- ui::putText(entity[i]->loc.x,entity[i]->loc.y,"%d",i);
- }
- }
safeSetColor(255+shade*2,0+shade,0+shade);
for(i=0;i<current->platform.size();i++){
glRectf(current->platform[i].p1.x,current->platform[i].p1.y+yoff-DRAW_Y_OFFSET,
}else{ // Otherwise reset static values and return
yoff=DRAW_Y_OFFSET;
shade=0;
+ for(i=0;i<entity.size()+1;i++){
+ if(entity[i]->inWorld==this){
+ entity[i]->draw();
+ ui::putText(entity[i]->loc.x,entity[i]->loc.y,"%d",i);
+ }
+ }
}
}
unsigned int i;
singleDetect(p);
for(i=0;i<entity.size()+1;i++){
- if(entity[i]->inWorld==this)
+ if(entity[i]->inWorld==this){
singleDetect(entity[i]);
+ }
}
}