std::vector<Platform> platform; // An array (vector thing) of platforms
int x_start; // Worlds are centered on the x axis (0,n), this contains
// where to start drawing the world to have it centered properly.
- World *behind,*infront; // Pointers to other areas of land that are behind or in front of this one, respectively.
+ World *behind; // Pointers to other areas of land that are behind or in front of this one, respectively.
void singleDetect(Entity *e); // Handles an individual entity (gravity n' stuff)
public:
unsigned int lineCount; // Size of the array 'line' (aka the width of the world)
World *toLeft,*toRight; // Pointers to areas to the left and right of this world. These are made public
// so that they can easily be set without a function.
+ World *infront;
World(void);
~World(void); // Frees the 'line' array.
void addHole(unsigned int start,unsigned int end); // Create a hole in the world
};
+float worldGetYBase(World *w);
+
/*
* IndoorWorld - Indoor settings stored in a World class ;)
*/
glTexCoord2i(0,0);glVertex2i(-SCREEN_WIDTH*2,SCREEN_HEIGHT);
glEnd();
+ int base = 50 - (int)worldGetYBase(currentWorld);
+
glBindTexture(GL_TEXTURE_2D, bgTreesFirst);
glColor4ub(255,255,255,255);
glBegin(GL_QUADS);
- glTexCoord2i(0,1);glVertex2i(-960 +player->loc.x*.25, 50);
- glTexCoord2i(1,1);glVertex2i(960 +player->loc.x*.25, 50);
- glTexCoord2i(1,0);glVertex2i(960 +player->loc.x*.25, 1130);
- glTexCoord2i(0,0);glVertex2i(-960 +player->loc.x*.25, 1130);
+ glTexCoord2i(0,1);glVertex2i(-960+player->loc.x*.25,base);
+ glTexCoord2i(1,1);glVertex2i( 960+player->loc.x*.25,base);
+ glTexCoord2i(1,0);glVertex2i( 960+player->loc.x*.25,base+1080);
+ glTexCoord2i(0,0);glVertex2i(-960+player->loc.x*.25,base+1080);
glEnd();
glDisable(GL_TEXTURE_2D);