]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
updated goals
authorClyne Sullivan <tullivan99@gmail.com>
Tue, 3 Nov 2015 01:48:31 +0000 (20:48 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Tue, 3 Nov 2015 01:48:31 +0000 (20:48 -0500)
Changelog
Goals.txt
include/common.h
include/world.h
main.cpp
src/entities.cpp
src/gameplay.cpp
src/inventory.cpp
src/ui.cpp
src/world.cpp

index 0bb86d9b541aa8a5e261a046e3b91762f9b19207..d53ac1399fde327e0684d4cae70538c64dea7e87 100644 (file)
--- a/Changelog
+++ b/Changelog
          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)
index 46a35b712f25179e4bca94a2fce6e56fb258e85f..0164d82fd58410c1f5fc38ea25b9a879c9d91f32 100644 (file)
--- a/Goals.txt
+++ b/Goals.txt
@@ -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:
 ================
index b0ffec76ed00865c1185089de49d413e86fdd597..b016020393c9cb74fcf861ee08e674f0451a4c35 100644 (file)
@@ -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
index 75263e55e01e5413f00b57caebd6088df33e3e72..85b02c9419a309af4d02bdbdf6e51c599de9c646 100644 (file)
@@ -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);
        
        /*
index e0d195f780986bfd8d9c0f8181c814f10ef9b8d8..56aed17f8609a17d05c77cb37f2be986bceefcc9 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -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();
index acc45bdcd1cdb5ee983b7bd68905fc726d1aba11..42ed5a9e547fd4fd1b44108a94f7fc8990b0fcde 100644 (file)
@@ -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);
        }
 }
index 964794fc4ca8281e77982deedee9fe716db1a3ee..f986ce3abf4e681ea13543bbb3b8cfd9643ca201 100644 (file)
@@ -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);
        
index 33af0a8a5e2188410bdbbcb733cf5e481b02538e..11f2ad797566a4d2be8d3e878423ff279fed0b99 100644 (file)
@@ -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;
index fa8cf9c9856c1020c92f305b0a5e0edc99862f1b..d138a0a30d1e890421257936ace3bf6f62a36726 100644 (file)
@@ -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){
index dccca2177bada5621ec60e50ba215f4b08fab2f9..36993b0d6b1d847471b8eca7ed5fd3fc0b715770 100644 (file)
@@ -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.
@@ -256,60 +260,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++){