void bindNext();
void bindPrev();
void bind(int);
+ void walk();
GLuint *image;
int texState;
private:
+
};
#endif //TEXTURE_H
\ No newline at end of file
|
2 MOBS
|->1 Rabbit
+|->2 Bird
**/
*/
static GLuint bgImage;
+static GLuint bgFar;
/*
* gameRunning
*/
bgImage=Texture::loadTexture("assets/bg.png");
+ bgFar = Texture::loadTexture("assets/bgfarMountains.png");
/*
* Load sprites used in the inventory menu. See src/inventory.cpp
glTexCoord2i(1,0);glVertex2i( SCREEN_WIDTH*2,SCREEN_HEIGHT);
glTexCoord2i(0,0);glVertex2i(-SCREEN_WIDTH*2,SCREEN_HEIGHT);
glEnd();
-
+
+ glBindTexture(GL_TEXTURE_2D, bgFar);
+ glColor4ub(255,255,255,155);
+ glBegin(GL_QUADS);
+ glTexCoord2i(0,1);glVertex2i(-SCREEN_WIDTH,0);
+ glTexCoord2i(1,1);glVertex2i( SCREEN_WIDTH,0);
+ glTexCoord2i(1,0);glVertex2i( SCREEN_WIDTH,391);
+ glTexCoord2i(0,0);glVertex2i(-SCREEN_WIDTH,391);
+ glEnd();
glDisable(GL_TEXTURE_2D);
/*
void Texturec::bindPrev(){
bind(--texState);
+}
+
+void Texturec::walk(){
+
}
\ No newline at end of file
type = NPCT; //sets type to npc
subtype = 0;
+
+ health = maxHealth = 100;
tex = new Texturec(1,"assets/NPC.png");
inv = new Inventory(NPC_INV_SIZE);
}
Mob::Mob(int sub){
- width = HLINE * 10;
- height = HLINE * 8;
type = MOBT; //sets type to MOB
subtype = sub; //SKIRL
- if(subtype == 1){//RABBIT
+ if(sub == 1){//RABBIT
+ width = HLINE * 10;
+ height = HLINE * 8;
tex = new Texturec(2, "assets/rabbit.png", "assets/rabbit1.png");
- }else if(subtype == 2){//BIRD
+ }else if(sub == 2){//BIRD
//add bird textures and bird things
+ width = HLINE * 8;
+ height = HLINE * 8;
+ tex = new Texturec(1, "assets/robin.png");
}
inv = new Inventory(NPC_INV_SIZE);
}
tex->bind(0);
}
break;
+ case 2: //RABBIT
+ if(ground == 0){
+ tex->bind(0);
+ }else if(ground == 1){
+ tex->bind(0);
+ }
+ break;
default:
break;
}
mob.push_back(new Mob(1));
entity.push_back(mob.back());
mob.back()->spawn(200,100);
+
+ mob.push_back(new Mob(2));
+ entity.push_back(mob.back());
+ mob.back()->spawn(200,100);
/*
* Link all the entities that were just created to the initial world, and setup a test AI function.