objects except for entities
- added stars at night
- successfully enabled and loaded GLSL shaders
+
+11/2/2015:
+==========
+
+ - improved shaders (can now see drawn objects)
+ - re-organized Goals.txt
+ - began working on game concept/design/plot/everything (in google doc)
End of October:
===============
- - have textures for the world and entities (png's and stuff) check!
- - have basic quest handling/player can interact with NPCs to take quests check!
- - have basic mobs/animals check?
+ - have textures for the world and entities (png's and stuff)
+ - have basic quest handling/player can interact with NPCs to take quests
+ - have basic mobs/animals
+
+Summary:
+ NPCs and a village were created, and a basic quest handling structure was design so that
+the player could accept and complete quests from NPCs. Next we developed textures for the player,
+NPCs, house and background, using PNG loading from SDL_image. After that, Andy began to work on
+more textures for the game as well as animations for the player while Clyne worked on a player
+inventory and rewarding items from quest completions. While these were (are) still in development
+Andy added a basic template for mobs.
+
+End of November:
+================
+
+ - design the game
+ - work on GLSL shaders to replace the current 'fake' ones
+ - redesign what currently exists to match what is desired
+
+End of December:
+================
+
+ - create first 'chapters' of story
+ - create very first areas in the game (code it) to get an
+ idea of what's gonna go down
+
+January - March:
+===============
+
+ - design more story line...
+ - implement story line
+
+February - End of March:
+========================
+
+ - design sound effects / background music?
+
+March-ish:
+======
+
+ - allow friends to beta-test game
+ - modify game according to feedback
+
+April:
+====
+
+ - remove any remaining bugs in game
+ - get more testing done...
+ - look into methods of releasing the game (steam)
+
+May:
+====
+
+ - release game
+
+June:
+=====
+
+ - profit????
+
+
+********************************************************************************************************
+********************************************************************************************************
+Goals.txt before redesign:
+********************************************************************************************************
+********************************************************************************************************
End of November:
================
* This flag lets the compiler know that we are using shaders
*/
- #define SHADERSere
+#define SHADERS
/*
* Create a basic 2-point structure for coordinate saving
/*
* World - creates and handles an area of land
*/
+
class World {
protected:
* Keeps a dynamically allocated array of platforms in the world.
*/
- std::vector<Platform> platform;
-
/*
* Contains the starting x-coordinate to draw the world at. This should be equal to
* - getWidth() (see world.cpp) / 2
* These functions add features to the world.
*/
- void addPlatform(float x,float y,float w,float h);
void addHole(unsigned int start,unsigned int end);
/*
player->near=true; // Draw the player's name
- #ifdef SHADERS
- glUseProgramObjectARB(shaderProgram);
- glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), 0,100);
- glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 255,255,255);
- //glBlendFunc(GL_ONE, GL_ONE);
- #endif //SHADERS
-
currentWorld->draw(player);
#ifdef SHADERS
-<<<<<<< Updated upstream
glUseProgramObjectARB(shaderProgram);
glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), 640,100);
glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 1,1,1);
glRectf(offset.x-SCREEN_WIDTH/2,0,offset.x+SCREEN_WIDTH/2,SCREEN_HEIGHT);
#ifdef SHADERS
-=======
->>>>>>> Stashed changes
glUseProgramObjectARB(0);
#endif //SHADERS
/*
- * Draw UI elements. As of 10/20/2015 this includes the player's health bar and the dialog box.
+ * Draw UI elements. This includes the player's health bar and the dialog box.
*/
ui::draw();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
if(near){
- ui::setFontSize(14);
+ ui::setFontSize(10);
ui::putText(loc.x,loc.y-ui::fontSize-HLINE/2,"%s",name);
}
}
World *test=new World();
test->generate(SCREEN_WIDTH * 2);
test->addLayer(400);
-
- test->addPlatform(150,100,100,10);
test->addHole(100,150);
void Inventory::draw(void){
unsigned int i=0;
float y=SCREEN_HEIGHT/2,xoff;
+ ui::setFontSize(12);
ui::putText(offset.x-SCREEN_WIDTH/2,y,"Inventory:");
while(item[i].count){
y-=HLINE*12;
pw=putChar(xo,yo,s[i])+fontSize*.1;
xo+=pw;
}
- }while(s[i++]);
+ }while(s[++i]);
return xo;
}
float putText(const float x,const float y,const char *str,...){ // putText() simply runs 'str' and the extra arguments though
x=player->loc.x-SCREEN_WIDTH/2+HLINE*8;
y=SCREEN_HEIGHT-HLINE*8;
glRectf(x,y,x+SCREEN_WIDTH-HLINE*16,y-SCREEN_HEIGHT/4);
- setFontSize(16);
+ setFontSize(12);
putString(x+HLINE,y-fontSize-HLINE,dialogBoxText);
}
- setFontSize(16);
+ setFontSize(12);
putText(((SCREEN_WIDTH/2)+offset.x)-125,SCREEN_HEIGHT-fontSize,"Health: %u/%u",player->health>0?(unsigned)player->health:0,
(unsigned)player->maxHealth);
if(player->alive){
// or not calculated at all, so GEN_INC is also used to decrease 'lineCount' in functions like draw()
// and detect().
+#define GEN_MIN 40
+#define GEN_MAX 70
+#define GEN_INIT 60
+
#define GRASS_HEIGHT 4 // Defines how long the grass layer of a line should be in multiples of HLINE.
* Set an initial y to base generation off of, as generation references previous lines.
*/
- line[0].y=80;
+ line[0].y=GEN_INIT;
/*
* Populate every GEN_INCth line structure. The remaining lines will be based off of these.
* Generate a y value, ensuring it stays within a reasonable range.
*/
- line[i].y=rand() % 8 - 4 + line[i-GEN_INC].y; // Add +/- 4 to the previous line
- if(line[i].y < 40)line[i].y = 40; // Minimum bound
- else if(line[i].y > 70)line[i].y = 70; // Maximum bound
+ line[i].y=rand() % 8 - 4 + line[i-GEN_INC].y; // Add +/- 4 to the previous line
+ if(line[i].y < GEN_MIN)line[i].y = GEN_MIN; // Minimum bound
+ else if(line[i].y > GEN_MAX)line[i].y = GEN_MAX; // Maximum bound
}
*
*/
- if(!i||!(i%GEN_INC)){
+ if(!(i%GEN_INC)){
inc=(line[i + GEN_INC].y - line[i].y) / (float)GEN_INC;
* Calculate the x coordinate to start drawing this world from so that it is centered at (0,0).
*/
- x_start=0 - getWidth(this) / 2 + GEN_INC / 2 * HLINE;
+ x_start=0 - getWidth(this) / 2;
/*
* Nullify pointers to other worlds.
}
glEnd();
- /*
- * If we're drawing the closest/last world, handle and draw the player and entities in
- * the world.
- */
-
- if(current==this){
-
- /*
- * Calculate the line that the player is on
- */
-
- int ph = (p->loc.x + p->width / 2 - x_start) / HLINE;
-
- /*
- * If the player is on the ground, flatten the grass where the player is standing
- * by setting line.gs to false.
- */
-
- if(p->ground==1){
- for(i=0;i<lineCount-GEN_INC;i++){
- if(i < ph + 6 &&
- i > ph - 6 )
- cline[i].gs=false;
- else cline[i].gs=true;
- }
- }else{
- for(i=0;i<lineCount-GEN_INC;i++){
- cline[i].gs=true;
- }
- }
-
- /*
- * Draw the player.
- */
-
- p->draw();
-
- /*
- * Draw non-structure entities.
- */
-
- for(i=0;i<entity.size();i++){
- if(entity[i]->inWorld==this && entity[i]->type != STRUCTURET)
- entity[i]->draw();
- }
-
- }else{
-
- /*for(i=0;i<lineCount-GEN_INC;i++){
- cline[i].gs=true;
- }*/
-
- }
-
/*
* Draw grass on every line.
*/
glEnd();
/*
- * Restore the inverted shading if it was inverted above.
+ * If we're drawing the closest/last world, handle and draw the player and entities in
+ * the world.
*/
- shade*=-1;
+ if(current==this){
+
+ /*
+ * Calculate the line that the player is on
+ */
+
+ int ph = (p->loc.x + p->width / 2 - x_start) / HLINE;
+
+ /*
+ * If the player is on the ground, flatten the grass where the player is standing
+ * by setting line.gs to false.
+ */
+
+ if(p->ground==1){
+ for(i=0;i<lineCount-GEN_INC;i++){
+ if(i < ph + 6 &&
+ i > ph - 6 )
+ cline[i].gs=false;
+ else cline[i].gs=true;
+ }
+ }else{
+ for(i=0;i<lineCount-GEN_INC;i++){
+ cline[i].gs=true;
+ }
+ }
+
+ /*
+ * Draw the player.
+ */
+
+ p->draw();
+
+ /*
+ * Draw non-structure entities.
+ */
+
+ for(i=0;i<entity.size();i++){
+ if(entity[i]->inWorld==this && entity[i]->type != STRUCTURET)
+ entity[i]->draw();
+ }
+
+ }
/*
- * Draw platforms...
+ * Restore the inverted shading if it was inverted above.
*/
- 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,
- current->platform[i].p2.x, current->platform[i].p2.y + yoff - DRAW_Y_OFFSET);
- }
+ shade*=-1;
/*
* Draw the next closest world if it exists.
* Otherwise, if the entity is above the line...
*/
- }else if(e->loc.y > line[i].y - .002 * deltaTime){
-
- /*
- * Check for any potential platform collision (i.e. landing on a platform)
- */
-
- for(i=0;i<platform.size();i++){
-
- if(((e->loc.x + e->width > platform[i].p1.x) & (e->loc.x + e->width < platform[i].p2.x)) || // Check X left bounds
- ((e->loc.x < platform[i].p2.x) & (e->loc.x>platform[i].p1.x))){ // Check X right bounds
- if(e->loc.y > platform[i].p1.y && e->loc.y < platform[i].p2.y){ // Check Y bounds
-
- /*
- * Check if the entity is falling onto the platform so
- * that it doesn't snap to it when attempting to jump
- * through it.
- *
- */
-
- if(e->vel.y<=0){
-
- e->ground=2;
-
- e->vel.y=0;
- e->loc.y=platform[i].p2.y;
-
- //return; // May not be necessary
- }
- }
- }
- }
+ }else{
/*
* Handle gravity.
return this;
}
-void World::addPlatform(float x,float y,float w,float h){
- platform.push_back((Platform){{x,y},{x+w,y+h}});
-}
-
World *World::goInsideStructure(Player *p){
unsigned int i;
for(i=0;i<build.size();i++){