- added y-binding to ortho (if player is high in the sky ortho and UI will match it)
- added maximum to gravity's pull
- worked on storyline
+
+11/5/2015:
+===========
+
+ - wrote more storyline (up to 7 pages)
+ - fixed ortho for when player is inside a building
+ - began work on ray shading (flashlight)
+ - (out of class) began experimenting with writing game soundtracks
+
+ ~ About 3400 lines of code + documentation written
Player *player;
extern std::vector<Entity * > entity;
+/*
+ * Tells if player is currently inside a structure.
+*/
+
+extern bool worldInside;
+
/*
* tickCount contains the number of ticks generated since main loop entrance.
* This variable might be used anywhere.
* see past the world render
*/
- if(player->loc.x - SCREEN_WIDTH/2 < currentWorld->getTheWidth() * -0.5f)
- offset.x = ((currentWorld->getTheWidth() * -0.5f) + SCREEN_WIDTH / 2) + player->width / 2;
- if(player->loc.x + SCREEN_WIDTH/2 > currentWorld->getTheWidth() * 0.5f)
- offset.x = ((currentWorld->getTheWidth() * 0.5f) - SCREEN_WIDTH / 2) + player->width / 2;
+ if(!worldInside){
+ if(player->loc.x - SCREEN_WIDTH/2 < currentWorld->getTheWidth() * -0.5f)
+ offset.x = ((currentWorld->getTheWidth() * -0.5f) + SCREEN_WIDTH / 2) + player->width / 2;
+ if(player->loc.x + SCREEN_WIDTH/2 > currentWorld->getTheWidth() * 0.5f)
+ offset.x = ((currentWorld->getTheWidth() * 0.5f) - SCREEN_WIDTH / 2) + player->width / 2;
+ }
if(player->loc.y > 300 )
offset.y = player->loc.y + player->height;
glUseProgramObjectARB(0);
#endif //SHADERS
- #define rays
+ #define raysSHITUPMYASS
#ifdef rays
//LIGHT
extern std::vector<Entity *> entity;
extern std::vector<Structures *> build;
+bool worldInside = false;
+
float worldGetYBase(World *w){
float base = 0;
World *ptr = w;
if(build[i]->inWorld==this){
if(p->loc.x > build[i]->loc.x &&
p->loc.x + p->width < build[i]->loc.x + build[i]->width){
+ worldInside = true;
return (World *)build[i]->inside;
}
}else if(build[i]->inside==this){
p->loc.x=build[i]->loc.x + build[i]->width / 2 - p->width / 2;
p->loc.y=build[i]->loc.y + HLINE;
+ worldInside = false;
return (World *)build[i]->inWorld;
}
}