]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Fixed incorrect language percentages
authordrumsetmonkey <abelleisle@roadrunner.com>
Wed, 9 Mar 2016 02:14:47 +0000 (21:14 -0500)
committerdrumsetmonkey <abelleisle@roadrunner.com>
Wed, 9 Mar 2016 02:14:47 +0000 (21:14 -0500)
1  2 
.gitattributes
main.cpp
src/world.cpp

diff --cc .gitattributes
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b98fd9b7d4593a8d329113d42346a1978ac77263
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,6 @@@
++src/tinyxml2.cpp linguist-vendored
++src/threadpool.cpp linguist-vendored
++include/tinyxml2.h linguist-vendored
++include/threadpool.h linguist-vendored
++include/SDL2/* linguist-vendored
++include/freetype/* linguist-vendored
diff --cc main.cpp
index f0b49adf7ee68f0d6801e670e7a3bfb4db12b09c,1ff97cae80e5ad32c6ecfc954232c361fd5a42f0..f9282c43c50aa758b596682eee46eeca233e23e3
+++ b/main.cpp
@@@ -321,7 -323,6 +323,7 @@@ int main(int argc, char *argv[])
         */
        
        SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
-       SDL_GL_SetSwapInterval(0);
++      //SDL_GL_SetSwapInterval(0);
        
        glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
        
        ****     GAMELOOP      ****
        **************************/
        
 +      std::cout << "Num threads: " << std::thread::hardware_concurrency() << std::endl;
++
+       //currentWorld->mob.back()->followee = player;
+       
        gameRunning = true;
        while(gameRunning){
                mainLoop();
diff --cc src/world.cpp
index b2e1cfb77a22e63e178653e766229b4e8fdc560c,0a84c206d818aaf93af915f5689845296e8e6443..5ce0b2db073f1bc66546829a2c6e595eca375ab0
@@@ -317,36 -308,34 +308,34 @@@ update( Player *p, unsigned int delta 
        p->loc.y += p->vel.y                     * delta;
        p->loc.x +=(p->vel.x * p->speed) * delta;
        
-       /*
-        *      Update coordinates of all entities except for structures.
-       */
-       for(auto &e : entity){
+       // update entity coords
+       for ( auto &e : entity ) {
                e->loc.y += e->vel.y * delta;
                
-               if(e->type != STRUCTURET && e->canMove){
+         // dont let structures move?
+               if ( e->type != STRUCTURET && e->canMove ) {
                        e->loc.x += e->vel.x * delta;
                        
-                       if(e->vel.x < 0)e->left = true;
-                       else if(e->vel.x > 0)e->left = false;
+             // update boolean directions
+                       if ( e->vel.x < 0 )
+                 e->left = true;
+                       else if ( e->vel.x > 0 )
+                 e->left = false;
                }
        }
 -
+     // iterate through particles
+     particles.erase( std::remove_if( particles.begin(), particles.end(), [&delta](Particles &part){return part.kill(delta);}), particles.end());
+     for ( auto part = particles.begin(); part != particles.end(); part++ ) {
+               if ( (*part).canMove ) {
+                       (*part).loc.y += (*part).vely * delta;
+                       (*part).loc.x += (*part).velx * delta;
+                       for ( auto &b : build ) {
+                               if ( b->bsubtype == FOUNTAIN ) {
+                                       if ( (*part).loc.x >= b->loc.x && (*part).loc.x <= b->loc.x + b->width ) {
+                                               if ( (*part).loc.y <= b->loc.y + b->height * .25)
+                                                       particles.erase( part );
 +
-       for(unsigned int i=0;i<particles.size();i++){
-               if(particles[i]->kill(delta)){
-                       delete particles[i];
-                       particles.erase(particles.begin()+i);
-               }else if(particles[i]->canMove){
-                       particles[i]->loc.y += particles[i]->vely * delta;
-                       particles[i]->loc.x += particles[i]->velx * delta;
-                       for(auto &b : build){
-                               if(b->bsubtype==FOUNTAIN){
-                                       if(particles[i]->loc.x >= b->loc.x && particles[i]->loc.x <= b->loc.x + b->width){
-                                               if(particles[i]->loc.y <= b->loc.y + b->height * .25){
-                                                       delete particles[i];
-                                                       particles.erase(particles.begin()+i);
-                                               }
                                        }
                                }
                        }
@@@ -1656,4 -1512,11 +1512,12 @@@ loadWorldFromXMLNoSave( std::string pat
        }
  
        return tmp;
- }
++
+ }
+ Village::Village(const char *meme, World *w){
+       name = meme;
+       start.x = w->getTheWidth() / 2.0f;
+       end.x = -start.x;
+       in = false;
+ }