diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-11-02 20:48:31 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-11-02 20:48:31 -0500 |
commit | f8ebf8fd3d5691cd45566281a1f54c5ecbc43762 (patch) | |
tree | 35633b779419c0df9cdb2408838189d529357abf | |
parent | 07d73ea992641198a887f000bf44b874c8e11574 (diff) |
updated goals
-rw-r--r-- | Changelog | 7 | ||||
-rw-r--r-- | Goals.txt | 69 | ||||
-rw-r--r-- | include/common.h | 2 | ||||
-rw-r--r-- | include/world.h | 4 | ||||
-rw-r--r-- | main.cpp | 12 | ||||
-rw-r--r-- | src/entities.cpp | 2 | ||||
-rw-r--r-- | src/gameplay.cpp | 2 | ||||
-rw-r--r-- | src/inventory.cpp | 1 | ||||
-rw-r--r-- | src/ui.cpp | 6 | ||||
-rw-r--r-- | src/world.cpp | 161 |
10 files changed, 138 insertions, 128 deletions
@@ -215,3 +215,10 @@ 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) @@ -3,9 +3,72 @@ Goals: 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: ================ diff --git a/include/common.h b/include/common.h index b0ffec7..b016020 100644 --- a/include/common.h +++ b/include/common.h @@ -39,7 +39,7 @@ typedef unsigned int uint; * This flag lets the compiler know that we are using shaders */ - #define SHADERSere +#define SHADERS /* * Create a basic 2-point structure for coordinate saving diff --git a/include/world.h b/include/world.h index 75263e5..85b02c9 100644 --- a/include/world.h +++ b/include/world.h @@ -11,6 +11,7 @@ typedef struct { /* * World - creates and handles an area of land */ + class World { protected: @@ -36,8 +37,6 @@ 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 @@ -125,7 +124,6 @@ public: * 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); /* @@ -732,17 +732,9 @@ void render(){ 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); @@ -755,8 +747,6 @@ void render(){ glRectf(offset.x-SCREEN_WIDTH/2,0,offset.x+SCREEN_WIDTH/2,SCREEN_HEIGHT); #ifdef SHADERS -======= ->>>>>>> Stashed changes glUseProgramObjectARB(0); #endif //SHADERS @@ -764,7 +754,7 @@ void render(){ /* - * 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(); diff --git a/src/entities.cpp b/src/entities.cpp index acc45bd..42ed5a9 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -176,7 +176,7 @@ void Entity::draw(void){ //draws the entities glMatrixMode(GL_MODELVIEW); glPopMatrix(); if(near){ - ui::setFontSize(14); + ui::setFontSize(10); ui::putText(loc.x,loc.y-ui::fontSize-HLINE/2,"%s",name); } } diff --git a/src/gameplay.cpp b/src/gameplay.cpp index 964794f..f986ce3 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -37,8 +37,6 @@ void initEverything(void){ World *test=new World(); test->generate(SCREEN_WIDTH * 2); test->addLayer(400); - - test->addPlatform(150,100,100,10); test->addHole(100,150); diff --git a/src/inventory.cpp b/src/inventory.cpp index 33af0a8..11f2ad7 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -92,6 +92,7 @@ int Inventory::takeItem(ITEM_ID id,unsigned char count){ 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; @@ -136,7 +136,7 @@ namespace ui { 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 @@ -174,10 +174,10 @@ namespace ui { 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){ diff --git a/src/world.cpp b/src/world.cpp index dccca21..36993b0 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -7,6 +7,10 @@ // 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. @@ -57,7 +61,7 @@ void World::generate(unsigned int width){ // Generates the world and sets all va * 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. @@ -69,9 +73,9 @@ void World::generate(unsigned int width){ // Generates the world and sets all va * 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 } @@ -88,7 +92,7 @@ void World::generate(unsigned int width){ // Generates the world and sets all va * */ - if(!i||!(i%GEN_INC)){ + if(!(i%GEN_INC)){ inc=(line[i + GEN_INC].y - line[i].y) / (float)GEN_INC; @@ -124,7 +128,7 @@ void World::generate(unsigned int width){ // Generates the world and sets all va * 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. @@ -257,60 +261,6 @@ LOOP2: 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. */ @@ -359,21 +309,58 @@ LOOP2: 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. @@ -439,37 +426,7 @@ void World::singleDetect(Entity *e){ * 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. @@ -566,10 +523,6 @@ World *World::goWorldFront(Player *p){ 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++){ |