diff options
-rw-r--r-- | src/entities.cpp | 56 | ||||
-rw-r--r-- | src/gameplay.cpp | 2 |
2 files changed, 21 insertions, 37 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index f812919..26eb09a 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -183,17 +183,17 @@ Object::~Object(){ void Entity::draw(void){ //draws the entities glPushMatrix(); + glColor3ub(255,255,255); if(type==NPCT){ if(NPCp(this)->aiFunc.size()){ glColor3ub(255,255,0); glRectf(loc.x+width/3,loc.y+height,loc.x+width*2/3,loc.y+height+width/3); - }if(gender == MALE){ + } + if(gender == MALE){ glColor3ub(255,255,255); }else if(gender == FEMALE){ glColor3ub(255,105,180); } - }else{ - glColor3ub(255,255,255); } if(left){ glScalef(-1.0f,1.0f,1.0f); @@ -202,58 +202,44 @@ void Entity::draw(void){ //draws the entities glMatrixMode(GL_TEXTURE); glLoadIdentity(); glEnable(GL_TEXTURE_2D); - if(type == PLAYERT){ + switch(type){ + case PLAYERT: static int texState = 0; static bool up = true; - if(loops % (int)((float)2 / (float)speed) == 0){ + if(loops % (int)((float)3 / (float)speed) == 0){ if(up){ - texState+=1; - if(texState==2)up=false; + if(++texState==2)up=false; tex->bindNext(); - }else if(!up){ - texState-=1; - if(texState==0)up=true; + }else{ + if(!--texState)up=true; tex->bindPrev(); } } - if(ground == 0){ + if(!ground){ tex->bind(0); - }else if(vel.x != 0){ - switch(texState){ - case 0: - tex->bind(0); - break; - case 1: - tex->bind(1); - break; - case 2: - tex->bind(2); - break; - } + }else if(vel.x){ + tex->bind(texState); }else{ tex->bind(1); } - }else if(type == MOBT){ + break; + case MOBT: switch(subtype){ case MS_RABBIT: - if(ground == 0){ - tex->bind(1); - }else if(ground == 1){ - tex->bind(0); - } - break; - case MS_BIRD: - tex->bind(0); + tex->bind(!ground); break; case MS_TRIGGER: goto NOPE; break; + case MS_BIRD: default: tex->bind(0); break; } - }else{ + break; + default: tex->bind(0); + break; } glColor3ub(255,255,255); glBegin(GL_QUADS); @@ -266,9 +252,7 @@ NOPE: glDisable(GL_TEXTURE_2D); glMatrixMode(GL_MODELVIEW); glPopMatrix(); - if(near){ - ui::putStringCentered(loc.x+width/2,loc.y-ui::fontSize-HLINE/2,name); - } + if(near)ui::putStringCentered(loc.x+width/2,loc.y-ui::fontSize-HLINE/2,name); } void Player::interact(){ //the function that will cause the player to search for things to interact with diff --git a/src/gameplay.cpp b/src/gameplay.cpp index eb5ce79..8e7d961 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -51,7 +51,7 @@ void CUTSCENEEE(Mob *callee){ void CUTSCENEEE2(Mob *callee){ player->vel.x = 0; ui::dialogBox(player->name,":Yeah.", - "What the fuck is this dead end supposed to mean, and why does this place smell like soap?"); + "What the fuck is this dead end supposed to mean, and why this place smell like soap."); ui::waitForDialog(); callee->alive = false; } |