]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
improved non-jitteriness
authorClyne Sullivan <tullivan99@gmail.com>
Sun, 13 Sep 2015 01:57:35 +0000 (21:57 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Sun, 13 Sep 2015 01:57:35 +0000 (21:57 -0400)
Makefile
src/World.cpp

index d260819697b7d5ba897f954263d422fc327cf697..be0e49ee9f40d487aab74aba37516fe12b89d9a7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 FLAGS_LINUX = -lGL                 -lSDL2_image\r
 FLAGS_WIN32 = -lopengl32 -lmingw32 -lSDL2_Image\r
-FLAGS = -m32 -Iinclude -Wall -Werror -lSDL2main -lSDL2\r
+FLAGS = -m32 -std=c++11 -Iinclude -Wall -Werror -lSDL2main -lSDL2\r
 \r
 all:\r
        @g++ src/*.cpp -o main $(FLAGS_LINUX) $(FLAGS)\r
index 4c5d119974de3ce5904cdb7c5d35c054c11d8808..cb074b0cd14c4f1a0aa482967a21df01dd606cb8 100644 (file)
@@ -108,10 +108,10 @@ void World::detect(vec2 *v,vec2 *vel,const float width){
        for(i=0;i<lineCount-10;i++){                                                                                    // For every line in world\r
                if(v->y<line[i].start){                                                                                         // If we're inside the line\r
                        if(v->x>(HLINE*i)-1&&v->x<(HLINE*i)-1+HLINE){                                   // And we're inside it ;)\r
-                               vel->y=0;v->y=line[i].start+HLINE;                                                      // Correct\r
+                               vel->y=0;v->y=line[i].start+HLINE/4;                                                    // Correct\r
                                return; // :/\r
                        }else if(v->x+width>(HLINE*i)-1&&v->x+width<(HLINE*i)-1+HLINE){ // Same as above, but coming from right side instead of left\r
-                               vel->y=0;v->y=line[i].start+HLINE;\r
+                               vel->y=0;v->y=line[i].start+HLINE/4;\r
                                return; // ;)\r
                        }\r
                }else if(v->y>line[i].start+HLINE){                                                                     // Trashy gravity handling\r